immich/server/src/schema/migrations/1749067526135-UserOnboardingDefault.ts
2025-07-15 14:50:13 -04:00

13 lines
477 B
TypeScript

import { Kysely, sql } from 'kysely';
import { UserMetadataKey } from 'src/enum';
export async function up(db: Kysely<any>): Promise<void> {
await sql`INSERT INTO user_metadata SELECT id, ${UserMetadataKey.Onboarding}, '{"isOnboarded": true}' FROM users
ON CONFLICT ("userId", key) DO NOTHING
`.execute(db);
}
export async function down(db: Kysely<any>): Promise<void> {
await sql`DELETE FROM user_metadata WHERE key = ${UserMetadataKey.Onboarding}`.execute(db);
}