Method: Sequel::Migrator#initialize

Defined in:
lib/sequel/extensions/migration.rb

#initialize(db, directory, opts = OPTS) ⇒ Migrator

Setup the state for the migrator

Raises:


481
482
483
484
485
486
487
488
489
490
491
492
# File 'lib/sequel/extensions/migration.rb', line 481

def initialize(db, directory, opts=OPTS)
  raise(Error, "Must supply a valid migration path") unless File.directory?(directory)
  @db = db
  @directory = directory
  @allow_missing_migration_files = opts[:allow_missing_migration_files]
  @files = get_migration_files
  schema, table = @db.send(:schema_and_table, opts[:table] || default_schema_table)
  @table = schema ? Sequel::SQL::QualifiedIdentifier.new(schema, table) : table
  @column = opts[:column] || default_schema_column
  @ds = schema_dataset
  @use_transactions = opts[:use_transactions]
end