Add default blank desc and make approver optional
This commit is contained in:
parent
9b2449c846
commit
13f6ef8443
2 changed files with 4 additions and 4 deletions
|
@ -18,9 +18,9 @@ impl MigrationTrait for Migration {
|
|||
.not_null()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(Post::Description).text().not_null())
|
||||
.col(ColumnDef::new(Post::Description).text().not_null().default(""))
|
||||
.col(ColumnDef::new(Post::Uploader).text().not_null())
|
||||
.col(ColumnDef::new(Post::Approver).text().not_null())
|
||||
.col(ColumnDef::new(Post::Approver).text())
|
||||
.col(ColumnDef::new(Post::Rating).integer().not_null())
|
||||
.foreign_key(
|
||||
ForeignKey::create()
|
||||
|
|
|
@ -11,8 +11,8 @@ pub struct Model {
|
|||
pub description: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub uploader: String,
|
||||
#[sea_orm(column_type = "Text")]
|
||||
pub approver: String,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub approver: Option<String>,
|
||||
pub rating: i32,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue