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.
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 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
.
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
.
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
).
run_migration(migration_name::AbstractString, direction::Symbol; force = false) :: Nothing
Runs the migration corresponding to migration_name
in direction
. If force
is true, the migration is run regardless of its current status (already up
or down
).
##Arguments
migration_name::AbstractString
: The migration module name.direction::Symbol
: The direction of the migration. Must be:up
or:down
.force::Bool
: Iftrue
, the migration is run regardless of its current status (alreadyup
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.