Class: CreateSchools
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateSchools
- Defined in:
- lib/generators/reso/templates/create_schools.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/generators/reso/templates/create_schools.rb', line 2 def change create_table :schools, options: 'DEFAULT CHARSET=utf8' do |t| t.string :name t.references :school_category, index: true, null: false t.string :district t.text :description t. end add_index :schools, [:name, :school_category_id, :district], name: "name_category_district" end |