@vrplatform/kysely 1.3.45-stage.4987 → 1.3.45-stage.4994
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,53 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
create index if not exists source_bill_transfer_id_idx
|
|
7
|
+
on public.source (tenant_id, (json ->> 'transferId'))
|
|
8
|
+
where type = 'bill';
|
|
9
|
+
`.execute(db);
|
|
10
|
+
|
|
11
|
+
await sql`
|
|
12
|
+
create index if not exists sync_provider_payment_idempotency_key_idx
|
|
13
|
+
on core.sync (
|
|
14
|
+
tenant_id,
|
|
15
|
+
connection_id,
|
|
16
|
+
((params -> 'providerPayment') ->> 'idempotencyKey')
|
|
17
|
+
)
|
|
18
|
+
where params ? 'providerPayment';
|
|
19
|
+
`.execute(db);
|
|
20
|
+
|
|
21
|
+
await sql`
|
|
22
|
+
create index if not exists sync_provider_payment_transaction_ids_idx
|
|
23
|
+
on core.sync using gin (((params -> 'providerPayment') -> 'transactionIds'))
|
|
24
|
+
where params ? 'providerPayment';
|
|
25
|
+
`.execute(db);
|
|
26
|
+
|
|
27
|
+
await sql`
|
|
28
|
+
create index if not exists sync_payment_method_contact_id_idx
|
|
29
|
+
on core.sync (
|
|
30
|
+
tenant_id,
|
|
31
|
+
((params -> 'paymentMethod') ->> 'contactId')
|
|
32
|
+
)
|
|
33
|
+
where params ? 'paymentMethod';
|
|
34
|
+
`.execute(db);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
38
|
+
await sql`
|
|
39
|
+
drop index if exists core.sync_payment_method_contact_id_idx;
|
|
40
|
+
`.execute(db);
|
|
41
|
+
|
|
42
|
+
await sql`
|
|
43
|
+
drop index if exists core.sync_provider_payment_transaction_ids_idx;
|
|
44
|
+
`.execute(db);
|
|
45
|
+
|
|
46
|
+
await sql`
|
|
47
|
+
drop index if exists core.sync_provider_payment_idempotency_key_idx;
|
|
48
|
+
`.execute(db);
|
|
49
|
+
|
|
50
|
+
await sql`
|
|
51
|
+
drop index if exists public.source_bill_transfer_id_idx;
|
|
52
|
+
`.execute(db);
|
|
53
|
+
}
|