Class: CreateNeighborhoods
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateNeighborhoods
- Defined in:
- lib/generators/templates/migrations/create_neighborhoods.rb
Overview
Create neighborhood migration file
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/generators/templates/migrations/create_neighborhoods.rb', line 3 def change create_table :neighborhoods do |t| t.string :name t.string :zip_code t.references :city, index: true, foreign_key: true t.references :state, index: true, foreign_key: true t. null: false end end |