Skip to content

Commit 1c3fa68

Browse files
AadarshAadarsh
Aadarsh
authored and
Aadarsh
committed
Refactored mutations added api call functions into a single file and called independently
1 parent ac146ee commit 1c3fa68

13 files changed

+1872
-195
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Secrets*.toml
55
backups/
66
.env
77
*.log
8+

Cargo.lock

+53-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66
[dependencies]
77
async-graphql = { version = "7.0.15", features = ["chrono"] }
88
async-graphql-axum = "7.0.6"
9+
async-graphql-parser = "2.0"
910
axum = "0.8.1"
1011
chrono = { version = "0.4.38", features = ["clock"] }
1112
serde = { version = "1.0.188", features = ["derive"] }

migrations/20250312124630_add_leaderboard_tables.sql

+3-3
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)