DatabaseMigration
.IrreversibleMigrationException
.ExistingMigrationException
.MigrationNotFoundException
.newtable(migration_name::String, resource::String) :: String
Creates a new default migration file and persists it to disk in the configured migrations folder.
newtable(migration_name::String, resource::String) :: String
Creates a new default migration file and persists it to disk in the configured migrations folder.
relationship_table_name
.new, or new{A,B,...}
Special function available to inner constructors which creates a new object of the type. The form new{A,B,...} explicitly specifies values of parameters for parametric types. See the manual section on [Inner Constructor Methods](@ref man-inner-constructor-methods) for more information.
migration_file_name(migration_name::String) :: String
migration_file_name(cmd_args::Dict{String,Any}, config::Configuration.Settings) :: String
Computes the name of a new migration file.
migration_module_name(underscored_migration_name::String) :: String
Computes the name of the module of the migration based on the input from the user (migration name).
last_up(; force = false) :: Nothing
Migrates up the last migration. If force
is true
, the migration will be executed even if it's already up.
last_up(; force = false) :: Nothing
Migrates up the last migration. If force
is true
, the migration will be executed even if it's already up.
last_down() :: Nothing
Migrates down the last migration. If force
is true
, the migration will be executed even if it's already down.
last_down() :: Nothing
Migrates down the last migration. If force
is true
, the migration will be executed even if it's already down.
up(migration_module_name::String; force::Bool = false) :: Nothing
up_by_module_name(migration_module_name::String; force::Bool = false) :: Nothing
Runs up the migration corresponding to migration_module_name
.
up_by_module_name
.down(migration_module_name::String; force::Bool = false) :: Nothing
down_by_module_name(migration_module_name::String; force::Bool = false) :: Nothing
Runs down the migration corresponding to migration_module_name
.
down_by_module_name
.migration_by_module_name(migration_module_name::String) :: Union{Nothing,DatabaseMigration}
Computes the migration that corresponds to migration_module_name
.
all_migrations() :: Tuple{Vector{String},Dict{String,DatabaseMigration}}
Returns the list of all the migrations.
all_migrations() :: Tuple{Vector{String},Dict{String,DatabaseMigration}}
Returns the list of all the migrations.
run_migration(migration::DatabaseMigration, direction::Symbol; force = false) :: Nothing
Runs migration
in up or down, per directon
. If force
is true, the migration is run regardless of its current status (already up
or down
).
store_migration_status(migration::DatabaseMigration, direction::Symbol) :: Nothing
Persists the direction
of the migration
into the database.
all_with_status() :: Tuple{Vector{String},Dict{String,Dict{Symbol,Any}}}
Returns a list of all the migrations and their status.
create_table
.column
.columns
.column_id
.add_index
.add_indexes
.add_column
.add_columns
.drop_table
.remove_column
.remove_columns
.remove_index
.remove_indexes
.remove_indices
.create_sequence
.constraint
.nextval
.column_id_sequence
.remove_sequence
.drop_sequence
.create_migrations_table
.init
.