High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix: defensive album owner migration (#29200)
Daniel Dietzler805bb848773b
diff --git a/server/src/schema/migrations/1776848612954-MigrateAlbumOwnerIdToAlbumUser.ts b/server/src/schema/migrations/1776848612954-MigrateAlbumOwnerIdToAlbumUser.tsindex bb9d68a4ec..60c543f401 100644--- a/server/src/schema/migrations/1776848612954-MigrateAlbumOwnerIdToAlbumUser.ts+++ b/server/src/schema/migrations/1776848612954-MigrateAlbumOwnerIdToAlbumUser.ts@@ -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);