pub struct ColumnDefinition {
pub name: String,
pub data_type: DataType,
pub nullable: bool,
pub default: Option<DefaultValue>,
pub primary_key: bool,
pub unique: bool,
pub autoincrement: bool,
pub references: Option<ForeignKeyRef>,
pub check: Option<String>,
pub collation: Option<String>,
}Expand description
A complete column definition for migrations.
Fields§
§name: StringColumn name.
data_type: DataTypeData type.
nullable: boolWhether the column is nullable.
default: Option<DefaultValue>Default value.
primary_key: boolWhether this is a primary key.
unique: boolWhether this column is unique.
autoincrement: boolWhether this column auto-increments.
references: Option<ForeignKeyRef>Foreign key reference, if any.
check: Option<String>Check constraint expression, if any.
collation: Option<String>Collation for string columns.
Implementations§
Trait Implementations§
Source§impl Clone for ColumnDefinition
impl Clone for ColumnDefinition
Source§fn clone(&self) -> ColumnDefinition
fn clone(&self) -> ColumnDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnDefinition
impl Debug for ColumnDefinition
Source§impl PartialEq for ColumnDefinition
impl PartialEq for ColumnDefinition
impl StructuralPartialEq for ColumnDefinition
Auto Trait Implementations§
impl Freeze for ColumnDefinition
impl RefUnwindSafe for ColumnDefinition
impl Send for ColumnDefinition
impl Sync for ColumnDefinition
impl Unpin for ColumnDefinition
impl UnwindSafe for ColumnDefinition
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