我可以转储当前的Database#schema,但我想使用该架构创建一个新表(在不同的数据库中),但我不明白如何做到这一点?
DB = Sequel.connect('sqlite:///database_from.db')
schema = DB.schema :table
# schema => [[:id, {:auto_increment=>true, :allow_null=>false, :default=>nil, :primary_key=>true, :db_type=>"smallint(5) unsigned", :type=>:integer, :ruby_default=>nil}], [:field, {:allow_null=>true, :default=>nil, :primary_key=>false, :db_type=>"smallint(5) unsigned", :type=>:integer, :ruby_default=>nil}]]
DB2 = Sequel.connect('sqlite:///database_to.db')
DB2.create_table('table name', schema) #< allowing this would be cool!