Class: CreateCountries

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/project/db/migrate/30_create_countries.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/project/db/migrate/30_create_countries.rb', line 2

def change
  create_table :countries do |t|
    t.string :iso_code, index: true, null: false, limit: 2
    t.string :name, limit: 64
    t.boolean :eu
  end

  add_index :countries, :name, name: :countries_name, type: :fulltext

end