cirandas.net

ref: master

db/migrate/20110726121110_create_national_regions.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class CreateNationalRegions < ActiveRecord::Migration
  def self.up
    create_table :national_regions do |t|
      t.string :name
      t.string :national_region_code
      t.string :parent_national_region_code

      t.timestamps
    end

    add_index(:national_regions, :national_region_code, {:name => "code_index"})
    add_index(:national_regions, :name, {:name => "name_index"})
  end

  def self.down
    drop_table :national_regions
  end
end