mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
14 lines
711 B
TypeScript
14 lines
711 B
TypeScript
|
|
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);
|
||
|
|
}
|