-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deployment): adds deployment setting table
refs #714
- Loading branch information
1 parent
9723093
commit fa044a7
Showing
7 changed files
with
438 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE TABLE IF NOT EXISTS "deployment_settings" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"user_id" uuid NOT NULL, | ||
"dseq" varchar NOT NULL, | ||
"address" varchar NOT NULL, | ||
"auto_top_up_enabled" boolean DEFAULT false NOT NULL, | ||
"predicted_closed_height" bigint NOT NULL, | ||
"created_at" timestamp DEFAULT now(), | ||
"updated_at" timestamp DEFAULT now(), | ||
CONSTRAINT "dseq_address_idx" UNIQUE("dseq","address") | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "deployment_settings" ADD CONSTRAINT "deployment_settings_user_id_userSetting_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."userSetting"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.