Skip to content

Commit 1626748

Browse files
AadarshAadarshM07
authored andcommitted
refactor: leaderboard-related mutations
1 parent 928bc7a commit 1626748

15 files changed

+2128
-358
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Secrets*.toml
55
backups/
66
.env
77
*.log
8+

Cargo.lock

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

migrations/20250312124630_add_leaderboard_tables.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Add migration script here
22

3-
CREATE TABLE leaderboard (
3+
CREATE TABLE IF NOT EXISTS leaderboard (
44
id SERIAL PRIMARY KEY,
55
member_id INT UNIQUE NOT NULL,
66
leetcode_score INT,
@@ -10,7 +10,7 @@ CREATE TABLE leaderboard (
1010
FOREIGN KEY (member_id) REFERENCES member(member_id)
1111
);
1212

13-
CREATE TABLE leetcode_stats (
13+
CREATE TABLE IF NOT EXISTS leetcode_stats (
1414
id SERIAL PRIMARY KEY,
1515
member_id INT NOT NULL,
1616
leetcode_username VARCHAR(255) NOT NULL,
@@ -24,7 +24,7 @@ CREATE TABLE leetcode_stats (
2424
FOREIGN KEY (member_id) REFERENCES member(member_id)
2525
);
2626

27-
CREATE TABLE codeforces_stats (
27+
CREATE TABLE IF NOT EXISTS codeforces_stats (
2828
id SERIAL PRIMARY KEY,
2929
member_id INT NOT NULL,
3030
codeforces_handle VARCHAR(255) NOT NULL,

0 commit comments

Comments
 (0)