Skip to content

Commit 4c07280

Browse files
authored
Merge pull request #98 from crux-bphc/fix/duplicate-wrapped-entries
fix: duplicate wrapped entries
2 parents 7de3d30 + b1c4367 commit 4c07280

File tree

6 files changed

+21
-836
lines changed

6 files changed

+21
-836
lines changed

backend/src/drizzle/0001_create_wrapped_25_table.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ CREATE TABLE "wrapped_25" (
1010
"contest_count" integer DEFAULT 0 NOT NULL,
1111
"initial_rating" integer,
1212
"final_rating" integer,
13+
"highest_rating" integer,
1314
"potd_solves" integer,
1415
"campus_rank" integer NOT NULL,
15-
"batch_rank" integer NOT NULL
16+
"batch_rank" integer NOT NULL,
17+
CONSTRAINT "wrapped_25_user_id_unique" UNIQUE("user_id")
1618
);
1719
--> statement-breakpoint
1820
ALTER TABLE "wrapped_25" ADD CONSTRAINT "wrapped_25_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;

backend/src/drizzle/0002_add_wrapped_25_highest_rating_column.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

backend/src/drizzle/meta/0001_snapshot.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "49999ea9-9ee6-4d07-a7a3-1590cbb798c1",
2+
"id": "335e119b-5faa-46ca-8651-5f40253d9945",
33
"prevId": "8884fced-bb5e-4c80-90ec-93cb24c5e727",
44
"version": "7",
55
"dialect": "postgresql",
@@ -748,6 +748,12 @@
748748
"primaryKey": false,
749749
"notNull": false
750750
},
751+
"highest_rating": {
752+
"name": "highest_rating",
753+
"type": "integer",
754+
"primaryKey": false,
755+
"notNull": false
756+
},
751757
"potd_solves": {
752758
"name": "potd_solves",
753759
"type": "integer",
@@ -784,7 +790,15 @@
784790
}
785791
},
786792
"compositePrimaryKeys": {},
787-
"uniqueConstraints": {},
793+
"uniqueConstraints": {
794+
"wrapped_25_user_id_unique": {
795+
"name": "wrapped_25_user_id_unique",
796+
"nullsNotDistinct": false,
797+
"columns": [
798+
"user_id"
799+
]
800+
}
801+
},
788802
"policies": {},
789803
"checkConstraints": {},
790804
"isRLSEnabled": false

0 commit comments

Comments
 (0)