fix: 允许 page.image 为 None

This commit is contained in:
amtoaer
2024-03-30 01:40:40 +08:00
parent 51b319ffd5
commit 809b47bbbc
3 changed files with 4 additions and 4 deletions

View File

@@ -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<String>,
pub valid: bool,
pub download_status: u32,
pub created_at: String,

View File

@@ -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)]

View File

@@ -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(