Method: Tapsoob::Schema#dump_table

Defined in:
lib/tapsoob/schema.rb

#dump_table(database_url, table, options) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/tapsoob/schema.rb', line 34

def dump_table(database_url, table, options)
  table = table.to_sym
  Sequel.connect(database_url) do |db|
    db.extension :schema_dumper
    <<END_MIG
Class.new(Sequel::Migration) do
  def up
#{db.dump_table_schema(table, options)}
  end

  def down
drop_table("#{table}", if_exists: true)
  end
end
END_MIG
  end
end