@vrplatform/kysely 1.3.45-4807 → 1.3.45-4808
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,26 @@
|
|
|
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`
|
|
6
|
+
alter table accounting.bank_record
|
|
7
|
+
drop constraint bank_record_account_id_fkey,
|
|
8
|
+
add constraint bank_record_account_id_fkey
|
|
9
|
+
foreign key (account_id)
|
|
10
|
+
references accounting.account(id)
|
|
11
|
+
on update restrict
|
|
12
|
+
on delete cascade
|
|
13
|
+
`.execute(db);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
17
|
+
await sql`
|
|
18
|
+
alter table accounting.bank_record
|
|
19
|
+
drop constraint bank_record_account_id_fkey,
|
|
20
|
+
add constraint bank_record_account_id_fkey
|
|
21
|
+
foreign key (account_id)
|
|
22
|
+
references accounting.account(id)
|
|
23
|
+
on update restrict
|
|
24
|
+
on delete restrict
|
|
25
|
+
`.execute(db);
|
|
26
|
+
}
|