Skip to content

Instantly share code, notes, and snippets.

View zhuchangzhan's full-sized avatar

Zhuchang Zhan zhuchangzhan

View GitHub Profile
@dnnta
dnnta / city.rb
Created April 20, 2017 09:56
中国城市列表整理
# 数据来源 http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201703/t20170310_1471429.html
# 截止 2016 年 7 月 31 日
# 4 个直辖市下面的市辖区手动处理, 改为对应的名字,如 北京市-市辖区 改为 北京市-北京
# 其他市辖区, 直接去掉, 不入库
# 还有 4 个省直辖县级行政区划也手动处理, 去掉层级关系
class CreateChinaCities < ActiveRecord::Migration[5.0]
def change
create_table :china_cities do |t|
t.integer :code, index: true