2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/generators/sharp_zones/templates/migration.rb', line 2
def self.up
create_table "cities", :force => true do |t|
t.integer "province_id", :null => false
t.string "name"
t.timestamps
end
add_index "cities", "province_id"
create_table "provinces", :force => true do |t|
t.string "name"
t.timestamps
end
create_table "zones", :force => true do |t|
t.string "name", :null => false
t.integer "city_id", :null => false
t.timestamps
end
add_index "zones", "city_id"
end
|