Skip to content

Commit

Permalink
fix test case error: remove not null constraint for created_at & upda…
Browse files Browse the repository at this point in the history
…ted_at column
  • Loading branch information
billy1624 authored and Liber Wang committed Aug 8, 2022
1 parent fdd659e commit d9d77dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/common/features/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ pub struct Model {
pub id: i32,
pub pay: String,
pub amount: f64,
#[sea_orm(updated_at)]
#[sea_orm(updated_at, nullable)]
pub updated_at: DateTimeWithTimeZone,
#[sea_orm(created_at)]
#[sea_orm(created_at, nullable)]
pub created_at: DateTimeWithTimeZone,
}

Expand Down
12 changes: 2 additions & 10 deletions tests/common/features/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,8 @@ pub async fn create_check_table(db: &DbConn) -> Result<ExecResult, DbErr> {
)
.col(ColumnDef::new(check::Column::Pay).string().not_null())
.col(ColumnDef::new(check::Column::Amount).double().not_null())
.col(
ColumnDef::new(check::Column::UpdatedAt)
.timestamp_with_time_zone()
.not_null(),
)
.col(
ColumnDef::new(check::Column::CreatedAt)
.timestamp_with_time_zone()
.not_null(),
)
.col(ColumnDef::new(check::Column::UpdatedAt).timestamp_with_time_zone())
.col(ColumnDef::new(check::Column::CreatedAt).timestamp_with_time_zone())
.to_owned();

create_table(db, &stmt, Check).await
Expand Down

0 comments on commit d9d77dc

Please sign in to comment.