chore(server): sql versioning (#5346)

* chore(server): sql versioning

* chore: always add newline to end of file

* refactor: generator

* chore: pr feedback

* chore: pr feedback
This commit is contained in:
Jason Rasmussen
2023-11-30 10:10:30 -05:00
committed by GitHub
parent ffecfbe075
commit 5e55a17b2a
34 changed files with 3012 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { MoveEntity, PathType } from '../entities';
import { DummyValue, GenerateSql } from '../infra.util';
@Injectable()
export class MoveRepository implements IMoveRepository {
@@ -12,6 +13,7 @@ export class MoveRepository implements IMoveRepository {
return this.repository.save(entity);
}
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING] })
getByEntity(entityId: string, pathType: PathType): Promise<MoveEntity | null> {
return this.repository.findOne({ where: { entityId, pathType } });
}