Skip to content

Commit 61ba2ef

Browse files
AndrewAndrew
authored andcommitted
Align match schema types: cycle_id INT, feedback TEXT
1 parent 6945f5e commit 61ba2ef

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ spring-test/test-output/
2828

2929
# Maven artifacts
3030
/target/
31+
target_test*/
3132

3233
# Eclipse artifacts, including WTP generated manifests
3334
bin

db/migration/V0001__Create_members_table.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CREATE TABLE IF NOT EXISTS "members" (
22
id UUID PRIMARY KEY,
3-
full_name TEXT NOT NULL,
3+
first_name TEXT NOT NULL,
4+
last_name TEXT NOT NULL,
45
email TEXT UNIQUE NOT NULL,
56
linked_url TEXT,
67
bio TEXT,

db/migration/V0002__Create_match_cycles_table.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE IF NOT EXISTS "match_cycles" (
2-
id UUID PRIMARY KEY,
2+
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
33
period TEXT,
44
run_at TIMESTAMPTZ NOT NULL,
55
total_members INT,

db/migration/V0003__Create_matches_table.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ CREATE TABLE IF NOT EXISTS "matches" (
22
id UUID PRIMARY KEY,
33
member_a_id UUID NOT NULL,
44
member_b_id UUID NOT NULL,
5-
cycle_id UUID NOT NULL,
5+
cycle_id INT NOT NULL,
66
CONSTRAINT fk_member_a FOREIGN KEY (member_a_id) REFERENCES members(id) ON DELETE CASCADE ON UPDATE CASCADE,
77
CONSTRAINT fk_member_b FOREIGN KEY (member_b_id) REFERENCES members(id) ON DELETE CASCADE ON UPDATE CASCADE,
88
CONSTRAINT fk_cycle FOREIGN KEY (cycle_id) REFERENCES match_cycles(id) ON DELETE CASCADE ON UPDATE CASCADE,
99
match_score REAL,
1010
status TEXT,
11-
feedback_a INT,
12-
feedback_b INT,
11+
feedback_a TEXT,
12+
feedback_b TEXT,
1313
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
1414
);

0 commit comments

Comments
 (0)