-
manager
.create_table(
sea_query::Table::create()
.table(scene::Entity)
.if_not_exists()
.col(
ColumnDef::new(scene::Column::Id)
.integer()
.not_null()
.auto_increment()
.primary_key(),
)
.col(
ColumnDef::new(scene::Column::CreatedAt)
.date_time()
.not_null()
.default("CURRENT_TIMESTAMP"),
)
.col(
ColumnDef::new(scene::Column::UpdatedAt)
.date_time()
.not_null()
.default("CURRENT_TIMESTAMP"),
)
.to_owned(),
)
|
Beta Was this translation helpful? Give feedback.
Answered by
billy1624
Mar 21, 2022
Replies: 1 comment
-
Hey @rise0chen, this |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
billy1624
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @rise0chen, this
default
method, https://docs.rs/sea-query/0.23.0/sea_query/table/struct.ColumnDef.html#method.default, is intended to be setting default value instead of default expression. You can useextra
method for setting default expression for now. See SeaQL/sea-query#99 for details.