class Pakyow::Data::Adapters::Sql::Migrators::Finalizer

@api private

Attributes

migrations[R]

Public Class Methods

new(*) click to toggle source
# File lib/pakyow/data/adapters/sql/migrators/finalizer.rb, line 14
def initialize(*)
  super
  @migrations = []
end

Public Instance Methods

alter_table(name, &block) click to toggle source
# File lib/pakyow/data/adapters/sql/migrators/finalizer.rb, line 31
def alter_table(name, &block)
  writer = Writer.new(root: true)
  writer.alter_table(name, &block)
  @migrations << ["change_#{name}", writer]
end
associate_table(name, with:, &block) click to toggle source
# File lib/pakyow/data/adapters/sql/migrators/finalizer.rb, line 25
def associate_table(name, with:, &block)
  writer = Writer.new(root: true)
  writer.alter_table(name, &block)
  @migrations << ["associate_#{name}_with_#{with}", writer]
end
create_table(name, &block) click to toggle source
# File lib/pakyow/data/adapters/sql/migrators/finalizer.rb, line 19
def create_table(name, &block)
  writer = Writer.new(root: true)
  writer.create_table(name, &block)
  @migrations << ["create_#{name}", writer]
end

Private Instance Methods

type_for_attribute(attribute) click to toggle source
# File lib/pakyow/data/adapters/sql/migrators/finalizer.rb, line 39
def type_for_attribute(attribute)
  attribute.meta[:migration_type]
end