pub enum AlterAction {
AddColumn {
name: String,
type_name: String,
required: bool,
},
DropColumn {
name: String,
if_exists: bool,
},
AddIndex {
target: IndexTarget,
if_not_exists: bool,
},
AddUnique {
target: IndexTarget,
if_not_exists: bool,
},
DropIndex {
target: IndexTarget,
if_exists: bool,
},
AddLink {
name: String,
target: String,
local_key: String,
target_key: String,
},
}Expand description
An individual ALTER TABLE action.
Variants§
AddColumn
DropColumn
Fields
AddIndex
alter <Table> add index [if not exists] .<column> — creates a
B+Tree index on column. No-op if the index already exists.
Fields
target: IndexTargetAddUnique
alter <Table> add unique [if not exists] .<column> — creates a
UNIQUE B+Tree index on column. Scans existing data first and fails
if any duplicate (non-null) value is present. Without if not exists
it errors when the column is already indexed (no in-place upgrade);
with it, an existing index is a no-op.
DropIndex
alter <Table> drop index [if exists] <target> — removes either a
stored-column index or an expression index with the exact path identity.
AddLink
alter <Owner> add link <name> -> <Target> on <local> = <target>:
declare a persistent entity link on the altered type. Lowers to
Catalog::create_link; cardinality is derived there.
Trait Implementations§
Source§impl Clone for AlterAction
impl Clone for AlterAction
Source§fn clone(&self) -> AlterAction
fn clone(&self) -> AlterAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more