Skip to content

Commit

Permalink
feat: ✨ draft migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Dec 7, 2023
1 parent 0ab5220 commit f6fac7f
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 90 deletions.
2 changes: 1 addition & 1 deletion backend/entity/src/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Model {
#[sea_orm(nullable)]
pub contest_id: Option<i32>,
#[sea_orm(default_value = 0)]
pub accept_count: i32,
pub accept_count: u32,
#[sea_orm(default_value = 0)]
pub submit_count: u32,
#[sea_orm(default_value = 0.0, indexed)]
Expand Down
5 changes: 3 additions & 2 deletions backend/entity/src/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Model {
pub upload_at: DateTime,
#[sea_orm(nullable, indexed)]
pub time: Option<u64>,
#[sea_orm(nullable)]
#[sea_orm(nullable)]
pub accuracy: Option<u64>,
#[sea_orm(default_value = "false")]
pub committed: bool,
Expand All @@ -25,7 +25,8 @@ pub struct Model {
pub memory: Option<u64>,
#[sea_orm(default_value = 0, indexed)]
pub pass_case: i32,
pub status: u32,
#[sea_orm(nullable)]
pub status: Option<u32>,
#[sea_orm(default_value = false)]
pub accept: bool,
#[sea_orm(default_value = 0, indexed)]
Expand Down
2 changes: 0 additions & 2 deletions backend/entity/src/user_contest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)]
#[sea_orm(table_name = "user_contest")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = true)]
pub id: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub user_id: i32,
#[sea_orm(primary_key, auto_increment = false)]
Expand Down
Loading

0 comments on commit f6fac7f

Please sign in to comment.