From 809b47bbbc7536fe40d1757bf19cc612b5df82c7 Mon Sep 17 00:00:00 2001 From: amtoaer Date: Sat, 30 Mar 2024 01:40:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=81=E8=AE=B8=20page.image=20?= =?UTF-8?q?=E4=B8=BA=20None?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/src/entities/page.rs | 4 ++-- entity/src/entities/video.rs | 2 +- migration/src/m20240322_000001_create_table.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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(