You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEIF NOT EXISTS "easyinvoice_client_payment" (
2
+
"id"textPRIMARY KEYNOT NULL,
3
+
"userId"textNOT NULL,
4
+
"requestId"textNOT NULL,
5
+
"ecommerceClientId"textNOT NULL,
6
+
"invoiceCurrency"textNOT NULL,
7
+
"paymentCurrency"textNOT NULL,
8
+
"txHash"textNOT NULL,
9
+
"network"textNOT NULL,
10
+
"amount"textNOT NULL,
11
+
"customerInfo" json,
12
+
"reference"text,
13
+
"origin"text,
14
+
"created_at"timestamp DEFAULT now()
15
+
);
16
+
--> statement-breakpoint
17
+
DO $$ BEGIN
18
+
ALTERTABLE"easyinvoice_client_payment" ADD CONSTRAINT"easyinvoice_client_payment_userId_easyinvoice_user_id_fk"FOREIGN KEY ("userId") REFERENCES"public"."easyinvoice_user"("id") ON DELETE cascadeONUPDATE no action;
19
+
EXCEPTION
20
+
WHEN duplicate_object THEN null;
21
+
END $$;
22
+
--> statement-breakpoint
23
+
DO $$ BEGIN
24
+
ALTERTABLE"easyinvoice_client_payment" ADD CONSTRAINT"easyinvoice_client_payment_ecommerceClientId_easyinvoice_ecommerce_client_id_fk"FOREIGN KEY ("ecommerceClientId") REFERENCES"public"."easyinvoice_ecommerce_client"("id") ON DELETE cascadeONUPDATE no action;
25
+
EXCEPTION
26
+
WHEN duplicate_object THEN null;
27
+
END $$;
28
+
--> statement-breakpoint
29
+
CREATEUNIQUE INDEXIF NOT EXISTS "client_payment_request_id_tx_hash_unique"ON"easyinvoice_client_payment" USING btree ("requestId","txHash");--> statement-breakpoint
30
+
CREATEUNIQUE INDEXIF NOT EXISTS "ecommerce_client_user_id_client_id_unique"ON"easyinvoice_ecommerce_client" USING btree ("rnClientId");
0 commit comments