Class: CreateDistricts

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/mango_china_city/templates/create_districts.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/mango_china_city/templates/create_districts.rb', line 2

def change
  create_table :districts do |t|
    t.references :province
    t.references :city
    t.string :name, index: true, comment: '省名字'
    t.string :code, index: true, comment: '省Code'
    t.datetime :deleted_at

    t.timestamps
  end
end