lib/generators/china_regions/templates/migration.rb in china_regions-0.1.0 vs lib/generators/china_regions/templates/migration.rb in china_regions-0.4.2

- old
+ new

@@ -9,12 +9,10 @@ t.string :name_abbr t.timestamps end add_index :provinces, :name - add_index :provinces, :name_en - add_index :provinces, :name_abbr end unless table_exists? 'cities' create_table :cities do |t| t.string :name @@ -23,28 +21,21 @@ t.string :zip_code t.string :name_en t.string :name_abbr t.timestamps end + add_index :cities, :name - add_index :cities, :province_id - add_index :cities, :level - add_index :cities, :zip_code - add_index :cities, :name_en - add_index :cities, :name_abbr end - unless table_exists? 'districts' + unless table_exists? 'districts' create_table :districts do |t| t.string :name t.integer :city_id t.string :name_en t.string :name_abbr t.timestamps end add_index :districts, :name - add_index :districts, :city_id - add_index :districts, :name_en - add_index :districts, :name_abbr end end end