--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: apply
- !ruby/object:RI::MethodSummary 
  name: descendants
- !ruby/object:RI::MethodSummary 
  name: inherited
- !ruby/object:RI::MethodSummary 
  name: new
comment: 
- !ruby/struct:SM::Flow::P 
  body: "The Migration class describes a database migration that can be reversed. The migration looks very similar to ActiveRecord (Rails) migrations, e.g.:"
- !ruby/struct:SM::Flow::VERB 
  body: "  class CreateSessions &lt; Sequel::Migration\n    def up\n      create_table :sessions do\n        primary_key :id\n        String :session_id, :size =&gt; 32, :unique =&gt; true\n        DateTime :created_at\n        text :data\n      end\n    end\n\n    def down\n      # You can use raw SQL if you need to\n      self &lt;&lt; 'DROP TABLE sessions'\n    end\n  end\n\n  class AlterItems &lt; Sequel::Migration\n    def up\n      alter_table :items do\n        add_column :category, String, :default =&gt; 'ruby'\n      end\n    end\n\n    def down\n      alter_table :items do\n        drop_column :category\n      end\n    end\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "To apply a migration to a database, you can invoke the #apply with the target database instance and the direction :up or :down, e.g.:"
- !ruby/struct:SM::Flow::VERB 
  body: "  DB = Sequel.connect('sqlite://mydb')\n  CreateSessions.apply(DB, :up)\n"
- !ruby/struct:SM::Flow::P 
  body: "See Sequel::Schema::Generator for the syntax to use for creating tables, and Sequel::Schema::AlterTableGenerator for the syntax to use when altering existing tables. Migrations act as a proxy for the database given in #apply, so inside #down and #up, you can act as though self refers to the database. So you can use any of the Sequel::Database instance methods directly."
constants: []

full_name: Sequel::Migration
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: down
- !ruby/object:RI::MethodSummary 
  name: method_missing
- !ruby/object:RI::MethodSummary 
  name: up
name: Migration
superclass: Object
