Skip to content

Instantly share code, notes, and snippets.

@theterminalguy
Created September 18, 2016 10:19
Show Gist options
  • Save theterminalguy/83a48668c1d5ddc90c156d567720895f to your computer and use it in GitHub Desktop.
Save theterminalguy/83a48668c1d5ddc90c156d567720895f to your computer and use it in GitHub Desktop.
States-cities-api schema
ActiveRecord::Schema.define(version: xxxxx) do
create_table "areas", force: :cascade do |t|
t.integer "town_id"
t.string "name"
end
add_index "areas", ["town_id"], name: "index_areas_on_town_id"
create_table "post_codes", force: :cascade do |t|
t.integer "area_id"
t.integer "code"
t.text "streets"
end
add_index "post_codes", ["area_id"], name: "index_post_codes_on_area_id"
add_index "post_codes", ["code"], name: "index_post_codes_on_code"
create_table "rural_districts", force: :cascade do |t|
t.integer "rural_lga_id"
t.string "name"
end
add_index "rural_districts", ["rural_lga_id"], name: "index_rural_districts_on_rural_lga_id"
create_table "rural_lgas", force: :cascade do |t|
t.integer "state_id"
t.string "name"
end
add_index "rural_lgas", ["state_id"], name: "index_rural_lgas_on_state_id"
create_table "rural_post_codes", force: :cascade do |t|
t.integer "rural_district_id"
t.integer "code"
t.string "towns"
end
add_index "rural_post_codes", ["rural_district_id"], name: "index_rural_post_codes_on_rural_district_id"
create_table "rural_towns", force: :cascade do |t|
t.integer "rural_district_id"
t.string "name"
end
add_index "rural_towns", ["rural_district_id"], name: "index_rural_towns_on_rural_district_id"
create_table "states", force: :cascade do |t|
t.string "code"
t.string "name"
t.string "capital"
t.float "lat"
t.float "lng"
t.integer "zone_id"
end
create_table "streets", force: :cascade do |t|
t.integer "area_id"
t.string "name"
end
add_index "streets", ["area_id"], name: "index_streets_on_area_id"
create_table "towns", force: :cascade do |t|
t.integer "state_id"
t.string "name"
end
add_index "towns", ["state_id"], name: "index_towns_on_state_id"
create_table "zones", force: :cascade do |t|
t.string "code"
t.string "name"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment