Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions drizzle/0004_previous_zodiak.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CREATE TABLE "project_media" (
"id" uuid PRIMARY KEY NOT NULL,
"project_id" uuid,
"media_id" uuid
);
--> statement-breakpoint
CREATE TABLE "project_upvotes" (
"profile_id" uuid NOT NULL,
"project_id" uuid NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "project_upvotes_profile_id_project_id_pk" PRIMARY KEY("profile_id","project_id")
);
--> statement-breakpoint
CREATE TABLE "roast_analytics" (
"id" uuid PRIMARY KEY NOT NULL,
"profile_id" uuid NOT NULL,
"total_roasts" integer DEFAULT 0 NOT NULL,
"first_roast_at" timestamp,
"last_roast_at" timestamp,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp NOT NULL
);
--> statement-breakpoint
CREATE TABLE "roast_history" (
"id" uuid PRIMARY KEY NOT NULL,
"profile_id" uuid NOT NULL,
"roasted_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "projects" ADD COLUMN "tagline" varchar(60) DEFAULT '' NOT NULL;--> statement-breakpoint
ALTER TABLE "project_media" ADD CONSTRAINT "project_media_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "project_media" ADD CONSTRAINT "project_media_media_id_media_id_fk" FOREIGN KEY ("media_id") REFERENCES "public"."media"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "project_upvotes" ADD CONSTRAINT "project_upvotes_profile_id_profile_id_fk" FOREIGN KEY ("profile_id") REFERENCES "public"."profile"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "project_upvotes" ADD CONSTRAINT "project_upvotes_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "roast_analytics" ADD CONSTRAINT "roast_analytics_profile_id_profile_id_fk" FOREIGN KEY ("profile_id") REFERENCES "public"."profile"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "roast_history" ADD CONSTRAINT "roast_history_profile_id_profile_id_fk" FOREIGN KEY ("profile_id") REFERENCES "public"."profile"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "profile" DROP COLUMN "qr_code_url";
3 changes: 3 additions & 0 deletions drizzle/0005_dear_edwin_jarvis.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "phone_number" text;
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "phone_number_collected" boolean DEFAULT false NOT NULL;
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "onboarding_call_id" text;
20 changes: 20 additions & 0 deletions drizzle/0006_blue_fenris.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CREATE TABLE "organizations" (
"id" uuid PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"name" varchar(120) NOT NULL,
"slug" varchar(50) NOT NULL,
"type" text NOT NULL,
"logo" uuid NOT NULL,
"description" text NOT NULL,
"address" text NOT NULL,
"email" text NOT NULL,
"phone" text NOT NULL,
"website" text NOT NULL,
"founded_year" integer NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp NOT NULL,
CONSTRAINT "organizations_slug_unique" UNIQUE("slug")
);
--> statement-breakpoint
ALTER TABLE "organizations" ADD CONSTRAINT "organizations_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "organizations" ADD CONSTRAINT "organizations_logo_media_id_fk" FOREIGN KEY ("logo") REFERENCES "public"."media"("id") ON DELETE cascade ON UPDATE no action;
Loading