Class: CreateCities

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/project/db/migrate/32_create_cities.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/32_create_cities.rb', line 2

def change
  create_table :cities do |t|
    t.string :name, limit: 64
    t.string :timezone, limit: 32
    t.belongs_to :country, index: true, null: false, foreign_key: true
  end

  add_index :cities, :name, name: :cities_name, type: :fulltext

end