Parent

Class Index [+]

Quicksearch

Sequel::Migration

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.

Public Class Methods

apply(db, direction) click to toggle source

Applies the migration to the supplied database in the specified direction.

    # File lib/sequel/extensions/migration.rb, line 32
32:     def self.apply(db, direction)
33:       raise(ArgumentError, "Invalid migration direction specified (#{direction.inspect})") unless [:up, :down].include?(direction)
34:       new(db).send(direction)
35:     end
descendants() click to toggle source

Returns the list of Migration descendants.

    # File lib/sequel/extensions/migration.rb, line 38
38:     def self.descendants
39:       @descendants ||= []
40:     end
inherited(base) click to toggle source

Adds the new migration class to the list of Migration descendants.

    # File lib/sequel/extensions/migration.rb, line 43
43:     def self.inherited(base)
44:       descendants << base
45:     end
new(db) click to toggle source

Set the database associated with this migration.

    # File lib/sequel/extensions/migration.rb, line 26
26:     def initialize(db)
27:       @db = db
28:     end
use_transactions() click to toggle source

Don’t allow transaction overriding in old migrations.

    # File lib/sequel/extensions/migration.rb, line 48
48:     def self.use_transactions
49:       nil
50:     end

Public Instance Methods

down() click to toggle source

The default down action does nothing

    # File lib/sequel/extensions/migration.rb, line 53
53:     def down
54:     end
method_missing(method_sym, *args, &block) click to toggle source

Intercepts method calls intended for the database and sends them along.

    # File lib/sequel/extensions/migration.rb, line 57
57:     def method_missing(method_sym, *args, &block)
58:       @db.send(method_sym, *args, &block)
59:     end
up() click to toggle source

The default up action does nothing

    # File lib/sequel/extensions/migration.rb, line 62
62:     def up
63:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.