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()
|
.not_null()
|
||||||
.primary_key(),
|
.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::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())
|
.col(ColumnDef::new(Post::Rating).integer().not_null())
|
||||||
.foreign_key(
|
.foreign_key(
|
||||||
ForeignKey::create()
|
ForeignKey::create()
|
||||||
|
|
|
@ -11,8 +11,8 @@ pub struct Model {
|
||||||
pub description: String,
|
pub description: String,
|
||||||
#[sea_orm(column_type = "Text")]
|
#[sea_orm(column_type = "Text")]
|
||||||
pub uploader: String,
|
pub uploader: String,
|
||||||
#[sea_orm(column_type = "Text")]
|
#[sea_orm(column_type = "Text", nullable)]
|
||||||
pub approver: String,
|
pub approver: Option<String>,
|
||||||
pub rating: i32,
|
pub rating: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue