pub enum JsonStatement {
Show 43 variants
CreateTable {
table: RichTable,
},
DropTable {
table: Table,
table_key: String,
},
RenameTable {
schema: String,
from: String,
to: String,
},
AddColumn {
column: Box<Column>,
is_pk: bool,
is_composite_pk: bool,
},
DropColumn {
column: Box<Column>,
},
AlterColumn {
to: Box<Column>,
was_enum: bool,
is_enum: bool,
diff: HashMap<String, Value>,
},
RenameColumn {
from: Box<Column>,
to: Box<Column>,
},
CreateIndex {
index: Index,
},
DropIndex {
index: Index,
},
CreateFk {
fk: ForeignKey,
},
DropFk {
fk: ForeignKey,
},
AddPk {
pk: PrimaryKey,
},
DropPk {
pk: PrimaryKey,
},
AddUnique {
unique: UniqueConstraint,
},
DropUnique {
unique: UniqueConstraint,
},
AddCheck {
check: CheckConstraint,
},
DropCheck {
check: CheckConstraint,
},
CreateSchema {
name: String,
},
DropSchema {
name: String,
},
RenameSchema {
from: Schema,
to: Schema,
},
CreateEnum {
enum_: Enum,
},
DropEnum {
enum_: Enum,
},
AlterEnum {
from: Enum,
to: Enum,
diff: Vec<EnumDiff>,
},
CreateSequence {
sequence: Sequence,
},
DropSequence {
sequence: Sequence,
},
CreateView {
view: View,
},
DropView {
view: View,
},
AlterView {
old_view: Box<View>,
new_view: Box<View>,
},
CreateRole {
role: Role,
},
DropRole {
role: Role,
},
CreatePolicy {
policy: Policy,
},
DropPolicy {
policy: Policy,
},
AlterTable {
old_table: Table,
new_table: Table,
},
RecreateFk {
old_fk: ForeignKey,
new_fk: ForeignKey,
},
RecreateUnique {
old_unique: UniqueConstraint,
new_unique: UniqueConstraint,
},
RecreateColumn {
old_column: Box<Column>,
new_column: Box<Column>,
},
RecreateIndex {
old_index: Box<Index>,
new_index: Box<Index>,
},
RecreatePk {
old_pk: PrimaryKey,
new_pk: PrimaryKey,
},
RecreateCheck {
old_check: CheckConstraint,
new_check: CheckConstraint,
},
RecreatePolicy {
old_policy: Box<Policy>,
new_policy: Box<Policy>,
},
AlterSequence {
old_sequence: Sequence,
new_sequence: Sequence,
},
AlterRole {
old_role: Role,
new_role: Role,
},
RecreateEnum {
old_enum: Enum,
new_enum: Enum,
columns: Vec<Column>,
},
}std only.Variants§
CreateTable
DropTable
RenameTable
AddColumn
DropColumn
AlterColumn
RenameColumn
CreateIndex
DropIndex
CreateFk
Fields
fk: ForeignKeyDropFk
Fields
fk: ForeignKeyAddPk
Fields
pk: PrimaryKeyDropPk
Fields
pk: PrimaryKeyAddUnique
Fields
unique: UniqueConstraintDropUnique
Fields
unique: UniqueConstraintAddCheck
Fields
check: CheckConstraintDropCheck
Fields
check: CheckConstraintCreateSchema
DropSchema
RenameSchema
CreateEnum
DropEnum
AlterEnum
CreateSequence
DropSequence
CreateView
DropView
AlterView
Alter a view by dropping and recreating (PostgreSQL doesn’t support ALTER VIEW for definition changes)
CreateRole
DropRole
CreatePolicy
DropPolicy
AlterTable
RecreateFk
RecreateUnique
RecreateColumn
Recreate column by dropping and re-adding (for generated columns, type changes, etc.)
RecreateIndex
Recreate an index by dropping and re-creating (PostgreSQL has no
general ALTER INDEX for definition changes).
RecreatePk
Recreate a primary key: DROP CONSTRAINT + ADD CONSTRAINT.
RecreateCheck
Recreate a check constraint: DROP CONSTRAINT + ADD CONSTRAINT.
RecreatePolicy
Recreate a policy: DROP POLICY + CREATE POLICY (drizzle-kit style).
AlterSequence
ALTER SEQUENCE with the changed options.
AlterRole
ALTER ROLE with the changed flags.
RecreateEnum
Recreate an enum type whose values were removed or reordered
(drizzle-kit flow: alter dependent columns to text, drop + recreate
the type, alter the columns back with USING ::text::type, restore
defaults).
Trait Implementations§
Source§impl Clone for JsonStatement
impl Clone for JsonStatement
Source§fn clone(&self) -> JsonStatement
fn clone(&self) -> JsonStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more