mirror of
https://github.com/immich-app/immich.git
synced 2026-03-07 10:37:22 +03:00
feat: rename schema (#19891)
This commit is contained in:
@@ -8,13 +8,13 @@ export class TrashRepository {
|
||||
constructor(@InjectKysely() private db: Kysely<DB>) {}
|
||||
|
||||
getDeletedIds(): AsyncIterableIterator<{ id: string }> {
|
||||
return this.db.selectFrom('assets').select(['id']).where('status', '=', AssetStatus.DELETED).stream();
|
||||
return this.db.selectFrom('asset').select(['id']).where('status', '=', AssetStatus.DELETED).stream();
|
||||
}
|
||||
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
async restore(userId: string): Promise<number> {
|
||||
const { numUpdatedRows } = await this.db
|
||||
.updateTable('assets')
|
||||
.updateTable('asset')
|
||||
.where('ownerId', '=', userId)
|
||||
.where('status', '=', AssetStatus.TRASHED)
|
||||
.set({ status: AssetStatus.ACTIVE, deletedAt: null })
|
||||
@@ -26,7 +26,7 @@ export class TrashRepository {
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
async empty(userId: string): Promise<number> {
|
||||
const { numUpdatedRows } = await this.db
|
||||
.updateTable('assets')
|
||||
.updateTable('asset')
|
||||
.where('ownerId', '=', userId)
|
||||
.where('status', '=', AssetStatus.TRASHED)
|
||||
.set({ status: AssetStatus.DELETED })
|
||||
@@ -42,7 +42,7 @@ export class TrashRepository {
|
||||
}
|
||||
|
||||
const { numUpdatedRows } = await this.db
|
||||
.updateTable('assets')
|
||||
.updateTable('asset')
|
||||
.where('status', '=', AssetStatus.TRASHED)
|
||||
.where('id', 'in', ids)
|
||||
.set({ status: AssetStatus.ACTIVE, deletedAt: null })
|
||||
|
||||
Reference in New Issue
Block a user