@vrplatform/kysely 1.3.45-5462 → 1.3.45-5491
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
6
|
+
await sql`
|
|
7
|
+
alter table core.sync
|
|
8
|
+
drop constraint if exists sync_user_id_fkey
|
|
9
|
+
`.execute(db);
|
|
10
|
+
await sql`
|
|
11
|
+
alter table public.audit_log
|
|
12
|
+
drop constraint if exists audit_log_actor_user_id_fkey
|
|
13
|
+
`.execute(db);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
17
|
+
await sql`
|
|
18
|
+
alter table core.sync
|
|
19
|
+
add constraint sync_user_id_fkey
|
|
20
|
+
foreign key (user_id)
|
|
21
|
+
references public."user"(id)
|
|
22
|
+
on update restrict
|
|
23
|
+
on delete set null
|
|
24
|
+
`.execute(db);
|
|
25
|
+
await sql`
|
|
26
|
+
alter table public.audit_log
|
|
27
|
+
add constraint audit_log_actor_user_id_fkey
|
|
28
|
+
foreign key (actor_user_id)
|
|
29
|
+
references public."user"(id)
|
|
30
|
+
on update restrict
|
|
31
|
+
on delete set null
|
|
32
|
+
`.execute(db);
|
|
33
|
+
}
|