Skip to content

Commit

Permalink
chore: delete confliciting migration files (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimduncan authored Jun 17, 2024
1 parent 52b8aa9 commit 749d158
Show file tree
Hide file tree
Showing 12 changed files with 462 additions and 931 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,37 @@ CREATE TABLE IF NOT EXISTS "users" (
CONSTRAINT "users_email_unique" UNIQUE("email")
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "onboarding_forms" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"form_id" text NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "form_datas" ADD CONSTRAINT "form_datas_form_id_forms_id_fk" FOREIGN KEY ("form_id") REFERENCES "public"."forms"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "forms" ADD CONSTRAINT "forms_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "oauth_account" ADD CONSTRAINT "oauth_account_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "onboarding_forms" ADD CONSTRAINT "onboarding_forms_form_id_forms_id_fk" FOREIGN KEY ("form_id") REFERENCES "public"."forms"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "email_verif_user_idx" ON "email_verification_codes" ("user_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "email_verif_idx" ON "email_verification_codes" ("email");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "form_idx" ON "form_datas" ("form_id");--> statement-breakpoint
Expand Down
6 changes: 0 additions & 6 deletions packages/db/drizzle/0001_cultured_echo.sql

This file was deleted.

17 changes: 0 additions & 17 deletions packages/db/drizzle/0001_mighty_iron_fist.sql

This file was deleted.

17 changes: 0 additions & 17 deletions packages/db/drizzle/0001_nostalgic_marvel_apes.sql

This file was deleted.

83 changes: 80 additions & 3 deletions packages/db/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "3b08f407-2220-4159-95e7-68a7faa162ea",
"id": "14203c94-ceaa-4515-b165-f9d5b62f84ed",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "6",
"dialect": "postgresql",
Expand Down Expand Up @@ -113,7 +113,21 @@
"isUnique": false
}
},
"foreignKeys": {},
"foreignKeys": {
"form_datas_form_id_forms_id_fk": {
"name": "form_datas_form_id_forms_id_fk",
"tableFrom": "form_datas",
"tableTo": "forms",
"columnsFrom": [
"form_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
Expand Down Expand Up @@ -208,7 +222,21 @@
"isUnique": false
}
},
"foreignKeys": {},
"foreignKeys": {
"forms_user_id_users_id_fk": {
"name": "forms_user_id_users_id_fk",
"tableFrom": "forms",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
Expand Down Expand Up @@ -453,6 +481,55 @@
]
}
}
},
"public.onboarding_forms": {
"name": "onboarding_forms",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"form_id": {
"name": "form_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"onboarding_forms_form_id_forms_id_fk": {
"name": "onboarding_forms_form_id_forms_id_fk",
"tableFrom": "onboarding_forms",
"tableTo": "forms",
"columnsFrom": [
"form_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
Expand Down
Loading

0 comments on commit 749d158

Please sign in to comment.