class PG::Schema::MigrationDSL

Attributes

migration[R]

Public Class Methods

new(&block) click to toggle source
# File lib/pg/schema-migration.rb, line 40
def initialize(&block)
  @migration = Migration.new
  instance_eval(&block)
end

Public Instance Methods

down(&block) click to toggle source
# File lib/pg/schema-migration.rb, line 50
def down(&block)
  @commands       = []
  @migration.down = block.call
end
execute(command) click to toggle source
# File lib/pg/schema-migration.rb, line 55
def execute(command)
  @commands << command
end
up(&block) click to toggle source
# File lib/pg/schema-migration.rb, line 45
def up(&block)
  @commands     = []
  @migration.up = block.call
end