diff --git a/entity/src/entities/page.rs b/entity/src/entities/page.rs index a534b14..9a2813b 100644 --- a/entity/src/entities/page.rs +++ b/entity/src/entities/page.rs @@ -2,7 +2,7 @@ use sea_orm::entity::prelude::*; -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)] #[sea_orm(table_name = "page")] pub struct Model { #[sea_orm(primary_key)] @@ -12,7 +12,7 @@ pub struct Model { pub pid: i32, pub name: String, pub path: String, - pub image: String, + pub image: Option, pub valid: bool, pub download_status: u32, pub created_at: String, diff --git a/entity/src/entities/video.rs b/entity/src/entities/video.rs index f84123d..28ae2d5 100644 --- a/entity/src/entities/video.rs +++ b/entity/src/entities/video.rs @@ -2,7 +2,7 @@ use sea_orm::entity::prelude::*; -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default)] #[sea_orm(table_name = "video")] pub struct Model { #[sea_orm(primary_key)] diff --git a/migration/src/m20240322_000001_create_table.rs b/migration/src/m20240322_000001_create_table.rs index 12d65d5..099aff8 100644 --- a/migration/src/m20240322_000001_create_table.rs +++ b/migration/src/m20240322_000001_create_table.rs @@ -96,7 +96,7 @@ impl MigrationTrait for Migration { .col(ColumnDef::new(Page::Pid).unsigned().not_null()) .col(ColumnDef::new(Page::Name).string().not_null()) .col(ColumnDef::new(Page::Path).string().not_null()) - .col(ColumnDef::new(Page::Image).string().not_null()) + .col(ColumnDef::new(Page::Image).string()) .col(ColumnDef::new(Page::Valid).boolean().not_null()) .col(ColumnDef::new(Page::DownloadStatus).unsigned().not_null()) .col(