ActiveRecord.MigrationProxy class
Part of Active Record
A stand-in for a migration file that has not been loaded yet. It carries the version, the name and the scope found in the file name, and includes the file only when the migration itself is needed.
Summary
Methods
basename()shared
Returns the name of the file without its folder.
camel_name()shared
Returns the name in CamelCase, as used in the console output.
Checks whether the migration asks to be run outside of a transaction.
Creates a stand-in for a migration file, which loads the file only when the migration is needed.
load()shared
Loads the migration file and returns the migration it defines, with the version and the name of the file set on it.
migrate(direction)shared
Runs the migration in the given direction.
Methods
ActiveRecord.MigrationProxy:basename()
shared packages/active_record/lib/migrator/migration_context.lua:45Returns the name of the file without its folder.
Returns
- String
ActiveRecord.MigrationProxy:camel_name()
shared packages/active_record/lib/migrator/migration_context.lua:39Returns the name in CamelCase, as used in the console output.
Returns
- String
ActiveRecord.MigrationProxy:disable_ddl_transaction()
shared packages/active_record/lib/migrator/migration_context.lua:86Checks whether the migration asks to be run outside of a transaction.
Returns
- Boolean
ActiveRecord.MigrationProxy:init(name, version, filename, scope)
shared packages/active_record/lib/migrator/migration_context.lua:29Creates a stand-in for a migration file, which loads the file only when the migration is needed.
Parameters
- name String underscored name of the migration, as found in the file name
- version Number
- filename String path of the file, relative to the Lua search path
- scope String optional, defaults to
nilscope suffix of the file name, e.g. the plugin a migration was installed from
Returns
- ActiveRecord::MigrationProxy(self)
ActiveRecord.MigrationProxy:load()
shared packages/active_record/lib/migrator/migration_context.lua:52Loads the migration file and returns the migration it defines, with the version and the name of the file set on it.
Returns
- ActiveRecord::Migration
ActiveRecord.MigrationProxy:migrate(direction)
shared packages/active_record/lib/migrator/migration_context.lua:80Runs the migration in the given direction.
Parameters
- direction String 'up' or 'down'