Skip to content

Commit

Permalink
fix: issue of missing migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
elskow committed Nov 24, 2024
1 parent 308520f commit 430a995
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions drizzle/0003_faithful_raider.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS "reviews" (
"id" uuid PRIMARY KEY NOT NULL,
"orderId" uuid NOT NULL,
"rating" integer NOT NULL,
"message" text,
"created_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "reviews_orderId_unique" UNIQUE("orderId")
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "reviews" ADD CONSTRAINT "reviews_orderId_orders_id_fk" FOREIGN KEY ("orderId") REFERENCES "public"."orders"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
2 changes: 1 addition & 1 deletion drizzle/meta/0003_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "4203ba70-272d-4ba0-971a-fd58a1715bcf",
"id": "c993af9b-dd05-47a1-93af-340600e9a7da",
"prevId": "d2471167-30ef-4960-bafd-ce84cf915fed",
"version": "7",
"dialect": "postgresql",
Expand Down
4 changes: 2 additions & 2 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
{
"idx": 3,
"version": "7",
"when": 1732429862609,
"tag": "0003_salty_lord_hawal",
"when": 1732446848193,
"tag": "0003_faithful_raider",
"breakpoints": true
}
]
Expand Down

0 comments on commit 430a995

Please sign in to comment.