pub struct ColumnDef {Show 13 fields
pub name: String,
pub rust_type: String,
pub ty: SqlType,
pub nullable: bool,
pub primary_key: bool,
pub unique: bool,
pub json: bool,
pub is_enum: bool,
pub index: bool,
pub default: Option<DefaultValue>,
pub references: Option<ForeignKey>,
pub check_in: Option<Vec<String>>,
pub renamed_from: Option<String>,
}Fields§
§name: String§rust_type: StringThe Rust type as written, with Option unwrapped (NaiveDateTime).
ty: SqlType§nullable: bool§primary_key: bool§unique: bool§json: boolStored as TEXT through serde (#[orm(json)]).
is_enum: boolColumn holds a value stored as TEXT via as_str()/FromStr: a
#[derive(DbEnum)] (with a CHECK from check_in) or an
#[orm(text)] type (no CHECK).
index: bool#[orm(index)] — a plain (non-unique) index on this column.
default: Option<DefaultValue>§references: Option<ForeignKey>§check_in: Option<Vec<String>>Allowed values (from the enum) — rendered as a CHECK constraint.
renamed_from: Option<String>One-shot rename marker: #[orm(renamed_from = "old")]. Remove the
attribute once the generated migration has been applied.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ColumnDef
impl<'de> Deserialize<'de> for ColumnDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ColumnDef
Auto Trait Implementations§
impl Freeze for ColumnDef
impl RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl UnsafeUnpin for ColumnDef
impl UnwindSafe for ColumnDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more