mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
fix(server): store null instead of empty string for person thumbnailPath
This commit is contained in:
parent
d7f46ccee3
commit
71a9070f4a
4 changed files with 17 additions and 4 deletions
|
|
@ -0,0 +1,13 @@
|
|||
import { Kysely, sql } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await sql`ALTER TABLE "person" ALTER COLUMN "thumbnailPath" DROP NOT NULL;`.execute(db);
|
||||
await sql`ALTER TABLE "person" ALTER COLUMN "thumbnailPath" SET DEFAULT NULL;`.execute(db);
|
||||
await sql`UPDATE "person" SET "thumbnailPath" = NULL WHERE "thumbnailPath" = '';`.execute(db);
|
||||
}
|
||||
|
||||
export async function down(): Promise<void> {
|
||||
await sql`UPDATE "person" SET "thumbnailPath" = '' WHERE "thumbnailPath" IS NULL;`.execute(db);
|
||||
await sql`ALTER TABLE "person" ALTER COLUMN "thumbnailPath" SET DEFAULT '';`.execute(db);
|
||||
await sql`ALTER TABLE "person" ALTER COLUMN "thumbnailPath" SET NOT NULL;`.execute(db);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue