Sha256: 311f130b7e86cc38ce98703b664b5aeacb348bcbe6bb6cb34c17abe702204d4c

Contents?: true

Size: 955 Bytes

Versions: 228

Compression:

Stored size: 955 Bytes

Contents

class CreateEducodeSalesRoles < ActiveRecord::Migration[5.2]
  def change
    create_table :educode_sales_roles do |t|
      t.string :name

      t.timestamps
    end
    add_column :educode_sales_staffs, :role_id, :integer
    add_column :educode_sales_staffs, :expired_at, :datetime
    add_column :educode_sales_staffs, :enabled_at, :datetime
    add_column :educode_sales_staffs, :job_type, :integer
    if EducodeSales::Common.first.nil?
      citys = ["北京", "上海", "广东", "江苏", "浙江", "重庆", "安徽", "福建", "甘肃", "广西", "贵州", "海南", "河北", "黑龙江", "河南", "湖北", "湖南", "江西", "吉林", "辽宁", "内蒙古", "宁夏", "青海", "山东", "山西", "陕西", "四川", "天津", "新疆", "西藏", "云南", "香港特别行政区", "澳门特别行政区", "台湾"]
      citys.each do |city|
        EducodeSales::Common.create(clazz: '区域', name: city)
      end
    end
  end
end

Version data entries

228 entries across 228 versions & 1 rubygems

Version Path
educode_sales-0.1.8 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.7 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.5 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.4 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.3 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.2 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.1 db/migrate/20210901025628_create_educode_sales_roles.rb
educode_sales-0.1.0 db/migrate/20210901025628_create_educode_sales_roles.rb