Sha256: fe5ff3a99dbdc26dbcb6c4fef885ea36b5930b2a3ffc5535fc29ab3a0bc736ea
Contents?: true
Size: 865 Bytes
Versions: 4
Compression:
Stored size: 865 Bytes
Contents
class CreateEchiVdns < ActiveRecord::Migration def self.up #We create the table from the one defined in the application.yml file create_table "echi_vdns", :force => true do |t| @@echi_schema["echi_vdns"].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 add_index "echi_vdns", "vdn" end def self.down remove_index "echi_vdns", "vdn" drop_table "echi_vdns" end end
Version data entries
4 entries across 4 versions & 1 rubygems