mirror of
https://github.com/immich-app/immich.git
synced 2026-06-27 22:35:57 +00:00
fix: defensive album owner migration (#29200)
This commit is contained in:
@@ -26,6 +26,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
.selectFrom('album')
|
||||
.select(['album.id as albumId', 'album.ownerId as userId', eb.val(AlbumUserRole.Owner).as('role')]),
|
||||
)
|
||||
.onConflict((cb) => cb.columns(['albumId', 'userId']).doUpdateSet({ role: AlbumUserRole.Owner }))
|
||||
.execute();
|
||||
await sql`ALTER TABLE "album" DROP CONSTRAINT "album_ownerId_fkey";`.execute(db);
|
||||
await sql`ALTER TABLE "album" DROP COLUMN "ownerId";`.execute(db);
|
||||
|
||||
Reference in New Issue
Block a user