abstract class Marten::DB::Migration
- Marten::DB::Migration
- Reference
- Object
Included Modules
Defined in:
marten/db/migration.crmarten/db/migration/dsl.cr
marten/db/migration/dsl/create_table.cr
marten/db/migration/operation/add_column.cr
marten/db/migration/operation/add_index.cr
marten/db/migration/operation/add_unique_constraint.cr
marten/db/migration/operation/base.cr
marten/db/migration/operation/change_column.cr
marten/db/migration/operation/create_table.cr
marten/db/migration/operation/delete_table.cr
marten/db/migration/operation/execute_sql.cr
marten/db/migration/operation/optimization/result.cr
marten/db/migration/operation/optimization/result_type.cr
marten/db/migration/operation/remove_column.cr
marten/db/migration/operation/remove_index.cr
marten/db/migration/operation/remove_unique_constraint.cr
marten/db/migration/operation/rename_column.cr
marten/db/migration/operation/rename_table.cr
marten/db/migration/operation/run_code.cr
Constructors
Class Method Summary
-
.atomic(atomic : Bool)
Allows to specify whether the whole migration should run inside a single transaction or not.
- .atomic? : Bool
-
.depends_on(app_name : String | Symbol, migration_name : String | Symbol)
Allows to specify the dependencies of the current migration.
- .depends_on
- .id
- .migration_name
- .replacement_ids
-
.replaces(app_name : String | Symbol, migration_name : String | Symbol)
Allows to specify the migrations the current migration is replacing.
- .replaces
Instance Method Summary
- #apply
- #apply_backward(pre_forward_project_state : Management::ProjectState, project_state : Management::ProjectState, schema_editor : Management::SchemaEditor::Base)
- #apply_forward(project_state : Management::ProjectState, schema_editor : Management::SchemaEditor::Base)
- #atomic?
- #id
- #mutate_state_forward(project_state : Management::ProjectState, preserve = true)
- #plan
- #unapply
Constructor Detail
Class Method Detail
Allows to specify whether the whole migration should run inside a single transaction or not.
By default, for databases that support DDL transactions, each migration will run inside a single transaction. This can be disabled on a per-migration basis, which can be useful is the migration is intended to affect large tables or when performing data migrations.
Allows to specify the dependencies of the current migration.
This class method takes an app_name
and a .migration_name
as argument and adds the corresponding migration
to the list of migration dependencies of the current migration.
Allows to specify the migrations the current migration is replacing.
This class method takes an app_name
and a .migration_name
as argument and adds the corresponding migration
to the list of migration replaced by the current migration.