Sequel's older migration class, available for backward compatibility. Uses subclasses with up and down instance methods for each migration:
Class.new(Sequel::Migration) do def up create_table(:artists) do primary_key :id String :name end end def down drop_table(:artists) end end
Part of the migration extension.
Applies the migration to the supplied database in the specified direction.
# File lib/sequel/extensions/migration.rb, line 35 def self.apply(db, direction) raise(ArgumentError, "Invalid migration direction specified (#{direction.inspect})") unless [:up, :down].include?(direction) new(db).send(direction) end
Returns the list of Migration descendants.
# File lib/sequel/extensions/migration.rb, line 41 def self.descendants @descendants ||= [] end
Adds the new migration class to the list of Migration descendants.
# File lib/sequel/extensions/migration.rb, line 46 def self.inherited(base) descendants << base end
The default down action does nothing
# File lib/sequel/extensions/migration.rb, line 56 def down end
Intercepts method calls intended for the database and sends them along.
# File lib/sequel/extensions/migration.rb, line 60 def method_missing(method_sym, *args, &block) @db.send(method_sym, *args, &block) end
Generated with the Darkfish Rdoc Generator 2.