Class: CreateCountries

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/forge/db/migrate/20130405172027_create_countries.rb

Instance Method Summary collapse

Instance Method Details

#downObject



17
18
19
# File 'lib/forge/db/migrate/20130405172027_create_countries.rb', line 17

def down
  drop_table :countries
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/forge/db/migrate/20130405172027_create_countries.rb', line 2

def up
  create_table "countries" do |t|
    t.string   "title"
    t.string   "code"
    t.boolean  "top_of_list", :default => false, :null => false
    t.boolean  "active",      :default => false, :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "countries", ["code"], :name => "index_countries_on_code", :unique => true
  add_index "countries", ["title"], :name => "index_countries_on_title"
  add_index "countries", ["top_of_list"], :name => "index_countries_on_top_of_list"
end