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

Returns the name of the file without its folder.
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.
Runs the migration in the given direction.

Methods

ActiveRecord.MigrationProxy:basename()

shared packages/active_record/lib/migrator/migration_context.lua:45

Returns the name of the file without its folder.

Returns

  • String

ActiveRecord.MigrationProxy:camel_name()

shared packages/active_record/lib/migrator/migration_context.lua:39

Returns 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:86

Checks 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:29

Creates 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 nil scope 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:52

Loads 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:80

Runs the migration in the given direction.

Parameters

  • direction String 'up' or 'down'

Defined in