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

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.

Public Class Methods

new() click to toggle source

Don't set transaction use by default.

    # File lib/sequel/extensions/migration.rb
 99 def initialize
100   @use_transactions = nil
101 end

Public Instance Methods

apply(db, direction) click to toggle source

Apply the appropriate block on the Database instance using instance_exec.

    # File lib/sequel/extensions/migration.rb
105 def apply(db, direction)
106   raise(ArgumentError, "Invalid migration direction specified (#{direction.inspect})") unless [:up, :down].include?(direction)
107   if prok = public_send(direction)
108     db.instance_exec(&prok)
109   end
110 end