Class | Sequel::SimpleMigration |
In: |
lib/sequel/extensions/migration.rb
|
Parent: | Object |
Migration class used by the Sequel.migration DSL, using instances for each migration, unlike the Migration class, which uses subclasses for each migration. Part of the migration extension.
down | [RW] | Proc used for the down action |
up | [RW] | Proc used for the up action |
use_transactions | [RW] | Whether to use transactions for this migration, default depends on the database. |
Don‘t set transaction use by default.
# File lib/sequel/extensions/migration.rb, line 85 85: def initialize 86: @use_transactions = nil 87: end
Apply the appropriate block on the Database instance using instance_eval.
# File lib/sequel/extensions/migration.rb, line 91 91: def apply(db, direction) 92: raise(ArgumentError, "Invalid migration direction specified (#{direction.inspect})") unless [:up, :down].include?(direction) 93: if prok = send(direction) 94: db.instance_eval(&prok) 95: end 96: end