pub enum AlterColumnOperation {
SetType {
data_type: DbType,
},
SetMaxLength {
max_length: i32,
},
DropMaxLength,
}Expand description
Representation of a single change to an existing column.
Each variant renders into exactly one ALTER TABLE statement, or into none at
all in sqlite: it has no ALTER COLUMN, and none of these changes are
observable in a STRICT table - DbType::VarChar and DbType::Text are
both TEXT, every integer is INTEGER, both floats are REAL, and a maximum
length is never enforced.
Variants§
SetType
Set the column’s type
The type has to be one which is fully described by itself. A
DbType::VarChar carries its maximum length and a DbType::Choices
its enum, so neither can be rendered from the type alone.
SetMaxLength
Add the check constraint enforcing the column’s maximum length
A column which already has one has to drop it first: a constraint can’t be redefined, only replaced.
DropMaxLength
Drop the check constraint enforcing the column’s maximum length
Trait Implementations§
Source§impl Clone for AlterColumnOperation
impl Clone for AlterColumnOperation
Source§fn clone(&self) -> AlterColumnOperation
fn clone(&self) -> AlterColumnOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more