#[non_exhaustive]pub enum Annotation {
AutoCreateTime,
AutoUpdateTime,
AutoIncrement,
Choices(Vec<String>),
DefaultValue(DefaultValue),
Index(Option<IndexValue>),
MaxLength(i32),
NotNull,
PrimaryKey,
Unique,
ForeignKey(ForeignKey),
}Expand description
The subset of annotations which need to be communicated with the migration tool
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AutoCreateTime
Only for DbType::Timestamp, DbType::DateTime, DbType::Time and DbType::Date. Will set the current time of the database when a row is created.
AutoUpdateTime
Only for DbType::Timestamp, DbType::DateTime, DbType::Time and DbType::Date. Will set the current time of the database when a row is updated.
AutoIncrement
AUTO_INCREMENT constraint
Choices(Vec<String>)
A list of choices to set
DefaultValue(DefaultValue)
DEFAULT constraint
Index(Option<IndexValue>)
Create an index. The optional IndexValue can be used, to build more complex indexes.
MaxLength(i32)
Specifies the maximum length of the column’s content.
It is part of the column’s type for a DbType::VarChar
and a check constraint for a DbType::Text.
Everywhere else, and in sqlite entirely, it is ignored -
sqlite has no varchar and never enforces a string’s length.
NotNull
NOT NULL constraint
PrimaryKey
The annotated column will be used as primary key
Unique
UNIQUE constraint
ForeignKey(ForeignKey)
Foreign Key constraint
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more