Skip to content

Commit

Permalink
#39 Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominux committed Jan 3, 2023
1 parent eb7e659 commit f228948
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion server/app/src/apps/games/repositories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl<'a> GamesRepository<'a> {
pub async fn create(&self) -> DGSResult<games::Model> {
let game = games::ActiveModel {
id: ActiveValue::Set(uuid::Uuid::new_v4()),
is_ended: ActiveValue::NotSet,
is_ended: ActiveValue::Set(false),
};
let game = game.insert(self.db).await?;

Expand Down
2 changes: 1 addition & 1 deletion server/app/src/common/db/entity/src/games.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub is_ended: Option<bool>,
pub is_ended: bool,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
6 changes: 0 additions & 6 deletions server/app/src/common/db/entity/src/mod.rs

This file was deleted.

4 changes: 0 additions & 4 deletions server/app/src/common/db/entity/src/prelude.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MigrationTrait for Migration {
.table(Game::Table)
.if_not_exists()
.col(ColumnDef::new(Game::Id).uuid().not_null().primary_key())
.col(ColumnDef::new(Game::IsEnded).boolean().default(false))
.col(ColumnDef::new(Game::IsEnded).boolean().not_null())
.to_owned(),
)
.await
Expand Down

0 comments on commit f228948

Please sign in to comment.