class Sequel::SimpleMigration
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.
Attributes
Proc used for the down action
Proc used for the up action
Whether to use transactions for this migration, default depends on the database.
Public Class Methods
Source
# File lib/sequel/extensions/migration.rb 101 def initialize 102 @use_transactions = nil 103 end
Don’t set transaction use by default.
Public Instance Methods
Source
# File lib/sequel/extensions/migration.rb 107 def apply(db, direction) 108 raise(ArgumentError, "Invalid migration direction specified (#{direction.inspect})") unless [:up, :down].include?(direction) 109 if prok = public_send(direction) 110 db.instance_exec(&prok) 111 end 112 end
Apply the appropriate block on the Database
instance using instance_exec.