class

Marten::DB::Migration::Operation::ExecuteSQL

Inherits Marten::DB::Migration::Operation::Base / Marten::DB::CanFormatStringsOrSymbols / Reference / Object

Constructors

new(forward_sql : String, backward_sql : String | Nil = nil)
Source

Instance methods

backward_sql
Source
describe

Returns a human-friendly description of what the operation is doing.

Source
forward_sql
Source
mutate_db_backward(app_label : String, schema_editor : Management::SchemaEditor::Base, from_state : Management::ProjectState, to_state : Management::ProjectState) : Nil

Applies the operation in a backward way at the database level.

For most operation, this will involve "unapplying" whatever was done as part of the #mutate_db_forward method.

Source
mutate_db_forward(app_label : String, schema_editor : Management::SchemaEditor::Base, from_state : Management::ProjectState, to_state : Management::ProjectState) : Nil

Applies the operation at the database level.

Source
mutate_state_forward(app_label : String, state : Management::ProjectState) : Nil

Applies the operation at the project state level.

Source
optimize(operation : Base) : Optimization::Result

Combines the specified operation with the current one and return an array of corresponding operations.

Source
references_column?(other_table_name : String, other_column_name : String) : Bool

Returns true if the operation references the specified table column.

Source
references_table?(other_table_name : String) : Bool

Returns true if the operation references the specified table.

Source
serialize

Renders a serialized version of the mutation.

This method is used when generating migrations: the serialized operation is inserted in the #plan method of the generated migration.

Source