Skip to content

Commit

Permalink
feat: new widgets functionality BE (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: yuhur <[email protected]>
  • Loading branch information
YuraGB and yuhur authored Mar 28, 2024
1 parent cb5a340 commit 2fcf76e
Show file tree
Hide file tree
Showing 29 changed files with 840 additions and 53 deletions.
35 changes: 35 additions & 0 deletions drizzle/0001_many_pyro.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CREATE TABLE IF NOT EXISTS "image_widget" (
"id" serial PRIMARY KEY NOT NULL,
"title" text DEFAULT '' NOT NULL,
"image_widget" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"image_link" text NOT NULL,
"group" text DEFAULT '' NOT NULL,
"image_title" text NOT NULL,
"image_src" text NOT NULL,
"page_id" integer
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "link_widget" (
"id" serial PRIMARY KEY NOT NULL,
"title" text DEFAULT '' NOT NULL,
"link_widget" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"link_url" text NOT NULL,
"group" text DEFAULT '' NOT NULL,
"link_title" text NOT NULL,
"page_id" integer
);
--> statement-breakpoint
ALTER TABLE "youtube_widget" ADD COLUMN "group" text DEFAULT '' NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "image_widget" ADD CONSTRAINT "image_widget_page_id_page_id_fk" FOREIGN KEY ("page_id") REFERENCES "page"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "link_widget" ADD CONSTRAINT "link_widget_page_id_page_id_fk" FOREIGN KEY ("page_id") REFERENCES "page"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 2fcf76e

Please sign in to comment.