Sha256: 9282dc0da69edac932b6079a0e34a0f2642d5e3e003e501f74886d9efb66f735
Contents?: true
Size: 808 Bytes
Versions: 4
Compression:
Stored size: 808 Bytes
Contents
class CreateEchiRecords < ActiveRecord::Migration def self.up #We create the table from the one defined in the application.yml file create_table "echi_records", :force => true do |t| @@echi_schema["echi_records"].each do | field | case field["type"] when 'int' t.column field["name"], :integer, :limit => field["length"], :precision => field["length"], :scale => 0 when 'str' t.column field["name"], :string, :limit => field["length"] when 'datetime' t.column field["name"], :datetime when 'bool' t.column field["name"], :string, :limit => 1 when 'boolint' t.column field["name"], :string, :limit => 1 end end end end def self.down drop_table "echi_records" end end
Version data entries
4 entries across 4 versions & 1 rubygems