Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: duplicate enum in multiple migration files issue🐛 #88

Merged
merged 2 commits into from
Dec 6, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TYPE "public"."activityType" AS ENUM('category_created', 'category_updated', 'category_deleted', 'group_created', 'group_deleted', 'group_member_added', 'group_member_removed', 'expense_added', 'expense_updated', 'expense_deleted');--> statement-breakpoint
CREATE TYPE "public"."activityType" AS ENUM('category_created', 'category_updated', 'category_deleted', 'group_created', 'group_deleted', 'group_updated', 'group_member_added', 'group_member_removed', 'expense_added', 'expense_updated', 'expense_deleted');--> statement-breakpoint
CREATE TYPE "public"."splitType" AS ENUM('even', 'uneven', 'proportional');--> statement-breakpoint
CREATE TYPE "public"."status" AS ENUM('settled', 'unsettled');--> statement-breakpoint
CREATE TYPE "public"."role" AS ENUM('user', 'admin');--> statement-breakpoint
Expand Down Expand Up @@ -91,6 +91,8 @@ CREATE TABLE IF NOT EXISTS "users" (
CREATE TABLE IF NOT EXISTS "users_to_groups" (
"user_id" varchar(60) NOT NULL,
"group_id" varchar(60) NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "users_to_groups_user_id_group_id_pk" PRIMARY KEY("user_id","group_id")
);
--> statement-breakpoint
Expand Down Expand Up @@ -167,4 +169,8 @@ EXCEPTION
END $$;
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "unique_name_userId_idx" ON "category" USING btree (lower("name"),"user_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "search_index" ON "category" USING gin ((
setweight(to_tsvector('english', "name"), 'A') ||
setweight(to_tsvector('english', "description"), 'B')
));--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "unique_email_idx" ON "users" USING btree (lower("email"));
6 changes: 0 additions & 6 deletions src/db/migrations/0001_red_korvac.sql

This file was deleted.

32 changes: 31 additions & 1 deletion src/db/migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "8fb066f1-9996-4499-823d-9f86259e2e06",
"id": "96948455-b2cc-46ab-9feb-e58e24a224ed",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
Expand Down Expand Up @@ -250,6 +250,21 @@
"concurrently": false,
"method": "btree",
"with": {}
},
"search_index": {
"name": "search_index",
"columns": [
{
"expression": "(\n setweight(to_tsvector('english', \"name\"), 'A') ||\n setweight(to_tsvector('english', \"description\"), 'B')\n )",
"asc": true,
"isExpression": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "gin",
"with": {}
}
},
"foreignKeys": {
Expand Down Expand Up @@ -697,6 +712,20 @@
"type": "varchar(60)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
Expand Down Expand Up @@ -753,6 +782,7 @@
"category_deleted",
"group_created",
"group_deleted",
"group_updated",
"group_member_added",
"group_member_removed",
"expense_added",
Expand Down
Loading
Loading