feat: add default value for serde
This commit is contained in:
@@ -4,7 +4,9 @@ use crate::mappings::SQLiteDatatypes;
|
||||
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
|
||||
pub struct Table {
|
||||
pub name: String,
|
||||
#[serde(default)]
|
||||
pub columns: Vec<Column>,
|
||||
#[serde(default)]
|
||||
pub strict: bool
|
||||
}
|
||||
|
||||
@@ -12,11 +14,17 @@ pub struct Table {
|
||||
pub struct Column {
|
||||
pub name: String,
|
||||
pub datatype: SQLiteDatatypes,
|
||||
#[serde(default)]
|
||||
pub nullable: bool,
|
||||
#[serde(default)]
|
||||
pub default: Option<String>,
|
||||
#[serde(default)]
|
||||
pub auto_increment: bool,
|
||||
#[serde(default)]
|
||||
pub unique: bool,
|
||||
#[serde(default)]
|
||||
pub check_constraint: Option<String>, // raw check constraint
|
||||
#[serde(default)]
|
||||
pub primary_key: bool
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user