class CreateCompetitionTzbUsers < ActiveRecord::Migration[5.2]
  def change
    # data = '{"Code":"Ok","Message":"成功","Data":[{"corp_id":123456,"match_id":666,"user_uid":"uid_y0gqNR3EesqZVgA","project_pid":"pid_123001","activation_code":"V2nyoEYzl2zRaVySpldc","project_status":"not_finished","project_status_text":"未提交",
    # "status_level":"school","status_level_text":"校级","school_code":"10003","school_name":"清华大学","province_name":"北京"},{"corp_id":123456,"match_id":666,"user_uid":"uid_JHnTBdt8GA3tziq","project_pid":"pid_123002","activation_code":"nde8u5HNQ7qqXjkBIQG0","project_status":"submit_to","project_status_text":"已提交","status_level":"school","status_level_text":"校级","school_code":"10003","school_name":"清华大学","province_name":"北京"},{"corp_id":123456,"match_id":666,"user_uid":"uid_2tCNcoKX8T8oHvk","project_pid":"pid_123003","activation_code":"iZQCh3mfuJ8ESrUPwGRo","project_status":"pass_by","project_status_text":"审核通过","status_level":"school","status_level_text":"校级","school_code":"10001","school_name":"北京大学","province_name":"北京"},{"corp_id":123456,"match_id":666,"user_uid":"uid_DziaXaNTkyS1M05","project_pid":"pid_123004","activation_code":"c42BKyehYWAxeAqjLdc8","project_status":"not_pass_by","project_status_text":"审核未通过","status_level":"province","status_level_text":"省级","school_code":"10001","school_name":"北京大学","province_name":"北京"}]}'

    create_table :competition_tzb_users do |t|
      t.string :user_uid
      t.string :user_email
      t.string :activation_code
      t.text :info_json
      t.integer :user_id
      t.string  :pwd
      t.boolean  :actived, default: false
      t.timestamps
    end

    add_index :competition_tzb_users, :user_uid
    add_index :competition_tzb_users, :activation_code
    add_index :competition_tzb_users, :user_id
  end
end
