mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-11 15:53:07 +00:00
Rae from website
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
453a143bfa
commit
a3e6df6ce8
13 changed files with 691 additions and 35 deletions
19
drizzle/0003_closed_alex_power.sql
Normal file
19
drizzle/0003_closed_alex_power.sql
Normal file
|
@ -0,0 +1,19 @@
|
|||
CREATE TABLE IF NOT EXISTS "journal_comments" (
|
||||
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "journal_comments_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||
"user" integer NOT NULL,
|
||||
"entry" integer NOT NULL,
|
||||
"content" varchar(512) NOT NULL,
|
||||
"date" timestamp NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "journal_comments" ADD CONSTRAINT "journal_comments_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
--> statement-breakpoint
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "journal_comments" ADD CONSTRAINT "journal_comments_entry_journal_entries_id_fk" FOREIGN KEY ("entry") REFERENCES "public"."journal_entries"("id") ON DELETE cascade ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
Loading…
Add table
Add a link
Reference in a new issue