Skip to content

Commit

Permalink
rename db module to models to better reflect its purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
ivinjabraham committed Jan 11, 2025
1 parent c733efc commit 7a96bce
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/attendance/scheduled_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sqlx::PgPool;
use std::sync::Arc;

use crate::{
db::{
models::{
leaderboard::{CodeforcesStats, LeetCodeStats},
member::Member,
},
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/mutations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::sync::Arc;

type HmacSha256 = Hmac<Sha256>;

use crate::db::{
use crate::models::{
attendance::Attendance,
leaderboard::{CodeforcesStats, LeetCodeStats},
member::Member,
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/query.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::db::{
use crate::models::{
attendance::Attendance,
leaderboard::{CodeforcesStatsWithName, LeaderboardWithMember, LeetCodeStatsWithName},
member::{Member, StreakUpdate},
};
use async_graphql::{Context, Object};
use chrono::NaiveDate;
use root::db::{
use root::models::{
attendance::{AttendanceStreak, AttendanceSummary, DailyCount, MemberAttendance},
projects::ActiveProjects,
};
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Need this to expose DB module for tests
// Need this to expose models module for tests
pub mod attendance;
pub mod db;
pub mod models;
pub mod leaderboard;
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tokio::task;
use tokio::time::{sleep_until, Instant};
use tower_http::cors::{Any, CorsLayer};

mod db;
mod models;
mod graphql;
mod leaderboard;
mod routes;
Expand Down
1 change: 0 additions & 1 deletion src/db/attendance.rs → src/models/attendance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use async_graphql::SimpleObject;
use chrono::{NaiveDate, NaiveTime};
use sqlx::FromRow;

//Struct for the Attendance table
#[derive(FromRow, SimpleObject)]
pub struct Attendance {
pub id: i32,
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions src/db/member.rs → src/models/member.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use async_graphql::SimpleObject;
use sqlx::FromRow;

//Struct for the Member table
#[derive(FromRow, SimpleObject)]

pub struct Member {
pub id: i32,
pub rollno: String,
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 7a96bce

Please sign in to comment.