Class: CreateSchools

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/reso/templates/create_schools.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



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.timestamps
  end
  add_index :schools, [:name, :school_category_id, :district], name: "name_category_district"
end