# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20260325000100) do

  create_table "1125_wx_users", force: :cascade do |t|
    t.integer  "user_id",              limit: 4
    t.integer  "invite_id",            limit: 4,                              default: 0
    t.string   "mp_openid",            limit: 64
    t.string   "openid",               limit: 64
    t.string   "nickname",             limit: 100
    t.string   "unionid",              limit: 64,                             default: "\"\""
    t.string   "city",                 limit: 20
    t.string   "country",              limit: 20
    t.string   "province",             limit: 20
    t.integer  "sex",                  limit: 1,                              default: 0
    t.string   "head",                 limit: 255
    t.boolean  "subscribe"
    t.boolean  "is_regist",                                                   default: false
    t.integer  "subscribe_time",       limit: 4,                              default: 0
    t.integer  "unsubscribe_time",     limit: 4,                              default: 0
    t.integer  "last_conversation_at", limit: 4,                              default: 0
    t.integer  "channel_qrcode_id",    limit: 4
    t.string   "signup_ip",            limit: 255
    t.string   "invite_qrcode_url",    limit: 255
    t.boolean  "show_invite_mode",                                            default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "intro_user_id",        limit: 4
    t.text     "intro_inner_no",       limit: 65535
    t.string   "intro_area",           limit: 2
    t.integer  "depth",                limit: 4,                              default: 0,      null: false
    t.decimal  "sale_group",                         precision: 12, scale: 2, default: 0.0,    null: false
    t.decimal  "sale_group_sum",                     precision: 20, scale: 2, default: 0.0,    null: false
    t.decimal  "sale_score",                         precision: 12, scale: 2
    t.integer  "rank",                 limit: 8,                              default: 0
    t.integer  "partner_time",         limit: 4,                              default: 0,      null: false
    t.string   "user_no",              limit: 128
  end

  add_index "1125_wx_users", ["last_conversation_at"], name: "index_1125_wx_users_on_last_conversation_at", using: :btree
  add_index "1125_wx_users", ["user_id"], name: "index_1125_wx_users_on_user_id", using: :btree

  create_table "ad_item_click_statistics", force: :cascade do |t|
    t.integer  "ad_item_id",      limit: 4,  null: false
    t.integer  "wx_uid",          limit: 4,  null: false
    t.string   "ip",              limit: 32
    t.integer  "click_times",     limit: 4,  null: false
    t.datetime "click_last_time"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ad_item_click_statistics", ["ad_item_id"], name: "index_ad_item_click_statistics_on_ad_item_id", using: :btree
  add_index "ad_item_click_statistics", ["wx_uid", "ad_item_id"], name: "index_ad_item_click_statistics_on_wx_uid_and_ad_item_id", unique: true, using: :btree
  add_index "ad_item_click_statistics", ["wx_uid"], name: "index_ad_item_click_statistics_on_wx_uid", using: :btree

  create_table "ad_item_show_statistics", force: :cascade do |t|
    t.integer  "ad_item_id",     limit: 4,  null: false
    t.integer  "wx_uid",         limit: 4,  null: false
    t.string   "ip",             limit: 32
    t.integer  "show_times",     limit: 4,  null: false
    t.datetime "show_last_time"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ad_item_show_statistics", ["ad_item_id"], name: "index_ad_item_show_statistics_on_ad_item_id", using: :btree
  add_index "ad_item_show_statistics", ["wx_uid", "ad_item_id"], name: "index_ad_item_show_statistics_on_wx_uid_and_ad_item_id", unique: true, using: :btree
  add_index "ad_item_show_statistics", ["wx_uid"], name: "index_ad_item_show_statistics_on_wx_uid", using: :btree

  create_table "ad_items", force: :cascade do |t|
    t.integer  "ad_position_id", limit: 4,                    null: false
    t.string   "name",           limit: 255,                  null: false
    t.text     "img",            limit: 65535,                null: false
    t.text     "click_url",      limit: 65535
    t.integer  "click_times",    limit: 4,     default: 0
    t.integer  "show_times",     limit: 4,     default: 0
    t.datetime "expired_at"
    t.boolean  "state",                        default: true
    t.integer  "sort",           limit: 4,     default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "url",            limit: 4096,  default: ""
    t.integer  "url_type",       limit: 1,     default: 0
  end

  add_index "ad_items", ["ad_position_id"], name: "index_ad_items_on_ad_position_id", using: :btree
  add_index "ad_items", ["sort"], name: "index_ad_items_on_sort", using: :btree

  create_table "ad_positions", force: :cascade do |t|
    t.string   "code",        limit: 255,                  null: false
    t.string   "name",        limit: 255,                  null: false
    t.string   "remark",      limit: 255,                  null: false
    t.integer  "click_times", limit: 4,     default: 0
    t.text     "img",         limit: 65535,                null: false
    t.text     "click_url",   limit: 65535
    t.boolean  "state",                     default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ad_positions", ["click_times"], name: "index_ad_positions_on_click_times", using: :btree
  add_index "ad_positions", ["code"], name: "index_ad_positions_on_code", unique: true, using: :btree

  create_table "addresses", force: :cascade do |t|
    t.integer  "user_id",    limit: 4
    t.string   "contact",    limit: 255
    t.string   "tel",        limit: 255
    t.string   "address",    limit: 255
    t.string   "postcode",   limit: 255
    t.string   "province",   limit: 255
    t.string   "city",       limit: 255
    t.string   "district",   limit: 255
    t.string   "remark",     limit: 255
    t.boolean  "state",                  default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "wx_user_id", limit: 4,   default: 0,     null: false
  end

  add_index "addresses", ["user_id"], name: "index_addresses_on_user_id", using: :btree
  add_index "addresses", ["wx_user_id"], name: "index_addresses_on_wx_user_id", using: :btree

  create_table "admin_departs", force: :cascade do |t|
    t.integer  "admin_user_id",    limit: 4,   default: 0, null: false
    t.integer  "depart_record_id", limit: 4,   default: 0, null: false
    t.string   "remark",           limit: 256
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "admin_departs", ["admin_user_id"], name: "index_admin_departs_on_admin_user_id", using: :btree

  create_table "admin_permissions", force: :cascade do |t|
    t.string "model", limit: 255, null: false
    t.string "can",   limit: 255, null: false
  end

  create_table "admin_permissions_admin_roles", force: :cascade do |t|
    t.integer "admin_role_id",       limit: 4
    t.integer "admin_permission_id", limit: 4
  end

  add_index "admin_permissions_admin_roles", ["admin_role_id", "admin_permission_id"], name: "idx_admin_permissions_roles_id", using: :btree
  add_index "admin_permissions_admin_roles", ["admin_role_id", "admin_permission_id"], name: "idx_admin_roles_id", using: :btree

  create_table "admin_roles", force: :cascade do |t|
    t.string "name",        limit: 255,   null: false
    t.text   "description", limit: 65535
  end

  create_table "admin_roles_admin_users", force: :cascade do |t|
    t.integer "admin_role_id", limit: 4
    t.integer "admin_user_id", limit: 4
  end

  create_table "admin_users", force: :cascade do |t|
    t.string   "email",                  limit: 255, default: "",    null: false
    t.string   "encrypted_password",     limit: 255, default: "",    null: false
    t.string   "name",                   limit: 255, default: "",    null: false
    t.boolean  "is_super_admin",                     default: false, null: false
    t.string   "reset_password_token",   limit: 255
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          limit: 4,   default: 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip",     limit: 255
    t.string   "last_sign_in_ip",        limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
  add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree

  create_table "agent_applys", force: :cascade do |t|
    t.integer  "happen_time",   limit: 4,   default: 0
    t.integer  "intro_user_id", limit: 4,   default: 0
    t.integer  "wx_user_id",    limit: 4,   default: 0
    t.string   "nickname",      limit: 255
    t.string   "mobile",        limit: 128
    t.integer  "depart",        limit: 4,   default: 0
    t.integer  "com_user_id",   limit: 4,   default: 0
    t.integer  "com_time",      limit: 4,   default: 0
    t.boolean  "status",                    default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "agent_applys", ["intro_user_id"], name: "idx_intro_user_id", using: :btree
  add_index "agent_applys", ["wx_user_id"], name: "idx_wx_user_id", using: :btree

  create_table "app_versions", force: :cascade do |t|
    t.datetime "created_at",                precision: 3
    t.datetime "updated_at",                precision: 3
    t.datetime "deleted_at",                precision: 3
    t.string   "app_type",      limit: 255
    t.string   "version",       limit: 255
    t.string   "version_code",  limit: 255
    t.boolean  "is_force"
    t.string   "apk_url",       limit: 255
    t.string   "upgrade_point", limit: 255
    t.boolean  "status"
    t.string   "app_version",   limit: 255
  end

  add_index "app_versions", ["deleted_at"], name: "idx_app_versions_deleted_at", using: :btree

  create_table "areas", force: :cascade do |t|
    t.integer  "level",       limit: 4
    t.integer  "parent_code", limit: 8
    t.integer  "area_code",   limit: 8
    t.string   "zip_code",    limit: 6
    t.string   "city_code",   limit: 6
    t.string   "name",        limit: 50
    t.string   "short_name",  limit: 50
    t.string   "merger_name", limit: 50
    t.float    "lng",         limit: 53
    t.float    "lat",         limit: 53
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "deleted_at"
  end

  add_index "areas", ["area_code"], name: "idx_areas_area_code", using: :btree
  add_index "areas", ["deleted_at"], name: "idx_areas_deleted_at", using: :btree
  add_index "areas", ["level"], name: "idx_areas_level", using: :btree
  add_index "areas", ["parent_code"], name: "idx_areas_parent_code", using: :btree

  create_table "article_cats", force: :cascade do |t|
    t.string  "name",     limit: 100,                 null: false
    t.integer "position", limit: 4
    t.string  "ancestry", limit: 100
    t.boolean "state",                default: false
  end

  add_index "article_cats", ["ancestry"], name: "index_article_cats_on_ancestry", using: :btree
  add_index "article_cats", ["name"], name: "index_article_cats_on_name", using: :btree
  add_index "article_cats", ["position"], name: "index_article_cats_on_position", using: :btree

  create_table "articles", force: :cascade do |t|
    t.string   "title",              limit: 100,                        null: false
    t.string   "subtitle",           limit: 100
    t.text     "about",              limit: 255
    t.text     "content",            limit: 4294967295,                 null: false
    t.text     "url",                limit: 65535
    t.string   "cover",              limit: 255
    t.string   "source",             limit: 100
    t.string   "editor",             limit: 100
    t.integer  "click",              limit: 4,          default: 0
    t.integer  "sort",               limit: 4,          default: 0
    t.integer  "recommend",          limit: 4
    t.boolean  "state",                                 default: false
    t.boolean  "display_cover",                         default: false
    t.string   "created_by",         limit: 100
    t.integer  "article_cat_id",     limit: 4,                          null: false
    t.integer  "agree",              limit: 4,          default: 0
    t.integer  "disagree",           limit: 4,          default: 0
    t.string   "tags",               limit: 255
    t.string   "seo_title",          limit: 255
    t.string   "seo_keyword",        limit: 255
    t.string   "seo_desc",           limit: 255
    t.text     "url_guide",          limit: 65535
    t.string   "share_benefit_desc", limit: 255
    t.boolean  "show_cs_qrcode",                        default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "s_title",            limit: 255
    t.string   "s_img",              limit: 255
  end

  add_index "articles", ["article_cat_id"], name: "index_articles_on_article_cat_id", using: :btree
  add_index "articles", ["title"], name: "index_articles_on_title", using: :btree

  create_table "balance_orders", force: :cascade do |t|
    t.string   "order_id",             limit: 64,                  null: false
    t.integer  "user_id",              limit: 4,                   null: false
    t.integer  "wx_user_id",           limit: 4
    t.string   "pay_way",              limit: 20
    t.string   "trade_no",             limit: 64
    t.integer  "paied_at",             limit: 4
    t.integer  "total_price",          limit: 8,   default: 0
    t.boolean  "state",                            default: false
    t.string   "remark",               limit: 255
    t.string   "balance_bank_card_no", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "paied_price",          limit: 8,   default: 0
    t.integer  "calc_flag",            limit: 4,   default: 0
    t.integer  "depart",               limit: 4
    t.integer  "present_flag",         limit: 4,   default: 0
    t.integer  "update_user",          limit: 4
  end

  add_index "balance_orders", ["depart"], name: "index_balance_orders_on_depart", using: :btree
  add_index "balance_orders", ["order_id"], name: "index_balance_orders_on_order_id", using: :btree
  add_index "balance_orders", ["user_id"], name: "index_balance_orders_on_user_id", using: :btree
  add_index "balance_orders", ["wx_user_id"], name: "index_balance_orders_on_wx_user_id", using: :btree

  create_table "balance_promotions", force: :cascade do |t|
    t.string   "name",       limit: 128
    t.datetime "begin_time"
    t.datetime "end_time"
    t.integer  "min_total",  limit: 4,   default: 0
    t.integer  "send_prod1", limit: 4,   default: 0
    t.integer  "send_nums1", limit: 4,   default: 0
    t.integer  "send_prod2", limit: 4,   default: 0
    t.integer  "send_nums2", limit: 4,   default: 0
    t.integer  "send_prod3", limit: 4,   default: 0
    t.integer  "send_nums3", limit: 4,   default: 0
    t.boolean  "is_enable",              default: true
    t.integer  "cash",       limit: 4,   default: 0
    t.integer  "cent",       limit: 4,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "max_total",  limit: 4,   default: 0
    t.integer  "depart",     limit: 4,   default: 0,    null: false
    t.integer  "is_more",    limit: 1,   default: 0
  end

  create_table "balances", force: :cascade do |t|
    t.integer  "user_id",    limit: 4
    t.integer  "wx_user_id", limit: 4
    t.integer  "count",      limit: 4
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "balances", ["relate_id"], name: "index_balances_on_relate_id", using: :btree
  add_index "balances", ["user_id"], name: "index_balances_on_user_id", using: :btree
  add_index "balances", ["wx_user_id"], name: "index_balances_on_wx_user_id", using: :btree

  create_table "base_configs", force: :cascade do |t|
    t.integer  "buy_cash",    limit: 4,   default: 0, null: false
    t.integer  "send_cash",   limit: 4,   default: 0, null: false
    t.integer  "cash_award",  limit: 4,   default: 0, null: false
    t.integer  "order_limit", limit: 4,   default: 0, null: false
    t.integer  "freight",     limit: 4,   default: 0, null: false
    t.integer  "user_apply",  limit: 4,   default: 0, null: false
    t.integer  "user_cash",   limit: 4,   default: 0, null: false
    t.integer  "user_award",  limit: 4,   default: 0, null: false
    t.integer  "agent_apply", limit: 4,   default: 0, null: false
    t.integer  "agent_cash",  limit: 4,   default: 0, null: false
    t.integer  "agent_award", limit: 4,   default: 0, null: false
    t.string   "remark",      limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "base_details", force: :cascade do |t|
    t.string   "order_no",     limit: 200, default: "0"
    t.integer  "product_id",   limit: 4,   default: 0
    t.integer  "dt_id",        limit: 4,   default: 0
    t.integer  "order_id",     limit: 4,   default: 0
    t.integer  "is_zeng",      limit: 1
    t.string   "size_name",    limit: 200
    t.string   "color_name",   limit: 200
    t.integer  "nums",         limit: 4,   default: 0
    t.integer  "price",        limit: 4,   default: 0
    t.string   "product_name", limit: 200
    t.integer  "depart",       limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "link_flag",    limit: 4,   default: 0
    t.string   "product_no",   limit: 128
    t.string   "order_status", limit: 64
  end

  create_table "bind_users", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.string   "user_no",    limit: 255
    t.string   "nickname",   limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "bind_users", ["wx_uid"], name: "index_bind_users_on_wx_uid", using: :btree

  create_table "carts", force: :cascade do |t|
    t.integer  "user_id",    limit: 8, default: 0
    t.integer  "wx_user_id", limit: 8, default: 0
    t.integer  "product_id", limit: 8, default: 0
    t.integer  "nums",       limit: 8, default: 0
    t.boolean  "is_buy",               default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "cash_balances", force: :cascade do |t|
    t.integer  "wx_uid",      limit: 4,                   null: false
    t.integer  "count",       limit: 4,                   null: false
    t.string   "source",      limit: 64
    t.string   "relate_id",   limit: 255
    t.string   "remark",      limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "profit_flag",             default: false, null: false
    t.string   "trade_no",    limit: 255, default: "",    null: false
  end

  add_index "cash_balances", ["wx_uid"], name: "index_cash_balances_on_wx_uid", using: :btree

  create_table "cent0_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent0_balances", ["wx_uid"], name: "index_cent0_balances_on_wx_uid", using: :btree

  create_table "cent1_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent1_balances", ["wx_uid"], name: "index_cent1_balances_on_wx_uid", using: :btree

  create_table "cent2_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent2_balances", ["wx_uid"], name: "index_cent2_balances_on_wx_uid", using: :btree

  create_table "cent3_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent3_balances", ["wx_uid"], name: "index_cent3_balances_on_wx_uid", using: :btree

  create_table "cent4_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent4_balances", ["wx_uid"], name: "index_cent4_balances_on_wx_uid", using: :btree

  create_table "cent5_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent5_balances", ["wx_uid"], name: "index_cent5_balances_on_wx_uid", using: :btree

  create_table "cent6_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent6_balances", ["wx_uid"], name: "index_cent6_balances_on_wx_uid", using: :btree

  create_table "cent7_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent7_balances", ["wx_uid"], name: "index_cent7_balances_on_wx_uid", using: :btree

  create_table "cent8_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent8_balances", ["wx_uid"], name: "index_cent8_balances_on_wx_uid", using: :btree

  create_table "cent9_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent9_balances", ["wx_uid"], name: "index_cent9_balances_on_wx_uid", using: :btree

  create_table "cent_awards", force: :cascade do |t|
    t.integer  "count",      limit: 4,   null: false
    t.string   "c_type",     limit: 64
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent_awards", ["c_type"], name: "index_cent_awards_on_c_type", using: :btree

  create_table "cent_balances", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,   null: false
    t.integer  "count",      limit: 4,   null: false
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "cent_balances", ["wx_uid"], name: "index_cent_balances_on_wx_uid", using: :btree

  create_table "channel_qrcode_results", force: :cascade do |t|
    t.string   "mp_openid",         limit: 255, default: "0"
    t.integer  "channel_qrcode_id", limit: 4
    t.datetime "created_at",                                  null: false
    t.datetime "updated_at",                                  null: false
  end

  add_index "channel_qrcode_results", ["channel_qrcode_id"], name: "index_channel_qrcode_results_on_channel_qrcode_id", using: :btree
  add_index "channel_qrcode_results", ["mp_openid", "channel_qrcode_id"], name: "index_channel_qrcode_results_on_openid_and_channel_qrcode_id", unique: true, using: :btree
  add_index "channel_qrcode_results", ["mp_openid"], name: "index_channel_qrcode_results_on_openid", using: :btree

  create_table "channel_qrcodes", force: :cascade do |t|
    t.integer  "wx_gongzhonghao_id",        limit: 4,                     null: false
    t.integer  "parent_sign_up_channel_id", limit: 4
    t.integer  "scene_id",                  limit: 4,     default: 0
    t.string   "scene_str",                 limit: 64
    t.boolean  "is_permanent",                            default: false
    t.text     "remark",                    limit: 65535,                 null: false
    t.text     "qrcode_img",                limit: 65535
    t.datetime "expired_at"
    t.integer  "scan_times",                limit: 4,     default: 0
    t.datetime "created_at",                                              null: false
    t.datetime "updated_at",                                              null: false
    t.integer  "push_after_sub_id",         limit: 4,     default: 0
    t.integer  "ad_cost",                   limit: 4,     default: 0
  end

  add_index "channel_qrcodes", ["expired_at"], name: "index_channel_qrcodes_on_expired_at", using: :btree

  create_table "ckeditor_assets", force: :cascade do |t|
    t.string   "data_file_name",    limit: 255, null: false
    t.string   "data_content_type", limit: 255
    t.integer  "data_file_size",    limit: 4
    t.integer  "assetable_id",      limit: 4
    t.string   "assetable_type",    limit: 30
    t.string   "type",              limit: 30
    t.integer  "width",             limit: 4
    t.integer  "height",            limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ckeditor_assets", ["assetable_type", "assetable_id"], name: "idx_ckeditor_assetable", using: :btree
  add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], name: "idx_ckeditor_assetable_type", using: :btree

  create_table "commend_words", force: :cascade do |t|
    t.integer  "sort",       limit: 4
    t.string   "title",      limit: 255
    t.boolean  "state",                  default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "common_use_limits", force: :cascade do |t|
    t.integer  "wx_uid",                   limit: 4,                 null: false
    t.boolean  "is_limit_up_benefit_list",           default: false
    t.boolean  "is_effect",                          default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "common_use_limits", ["wx_uid"], name: "index_common_use_limits_on_wx_uid", using: :btree

  create_table "delete_user", force: :cascade do |t|
    t.text     "result",     limit: 65535
    t.integer  "user_id",    limit: 8
    t.text     "wx_user",    limit: 65535
    t.datetime "created_at",               precision: 3
    t.datetime "updated_at",               precision: 3
  end

  create_table "depart_records", force: :cascade do |t|
    t.integer  "wx_user_id",   limit: 4,     default: 0,     null: false
    t.string   "name",         limit: 255
    t.text     "inner_no",     limit: 65535
    t.string   "remark",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "pick_title",   limit: 128
    t.string   "pick_address", limit: 128
    t.boolean  "pick",                       default: false
  end

  add_index "depart_records", ["wx_user_id"], name: "index_depart_records_on_wx_user_id", using: :btree

  create_table "depart_records_balance_promotions", force: :cascade do |t|
    t.integer "balance_promotion_id", limit: 4
    t.integer "depart_record_id",     limit: 4
  end

  add_index "depart_records_balance_promotions", ["balance_promotion_id", "depart_record_id"], name: "idx_balance_pomotion_d_r_id", using: :btree

  create_table "depart_records_group_messages", force: :cascade do |t|
    t.integer "group_message_id", limit: 4
    t.integer "depart_record_id", limit: 4
  end

  add_index "depart_records_group_messages", ["group_message_id", "depart_record_id"], name: "idx_group_message_id", using: :btree

  create_table "depart_records_live_broads", force: :cascade do |t|
    t.integer "live_broad_id",    limit: 4
    t.integer "depart_record_id", limit: 4
  end

  add_index "depart_records_live_broads", ["live_broad_id", "depart_record_id"], name: "idx_live_broad_id", using: :btree

  create_table "depart_records_products", force: :cascade do |t|
    t.integer "product_id",       limit: 4
    t.integer "depart_record_id", limit: 4
  end

  add_index "depart_records_products", ["product_id", "depart_record_id"], name: "idx_product_id", using: :btree

  create_table "depart_records_promotions", force: :cascade do |t|
    t.integer "promotion_id",     limit: 4
    t.integer "depart_record_id", limit: 4
  end

  add_index "depart_records_promotions", ["promotion_id", "depart_record_id"], name: "idx_pomotion_d_r_id", using: :btree

  create_table "depart_records_shop_promotions", force: :cascade do |t|
    t.integer "shop_promotion_id", limit: 4
    t.integer "depart_record_id",  limit: 4
  end

  add_index "depart_records_shop_promotions", ["shop_promotion_id", "depart_record_id"], name: "idx_shop_pomotion_d_r_id", using: :btree

  create_table "economic_statics", force: :cascade do |t|
    t.datetime "begin_time"
    t.integer  "balance",      limit: 4,   default: 0, null: false
    t.integer  "cash_balance", limit: 4,   default: 0, null: false
    t.integer  "cent",         limit: 4,   default: 0, null: false
    t.string   "remark",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "employ_static_foods", force: :cascade do |t|
    t.datetime "created_at",              precision: 3
    t.datetime "updated_at",              precision: 3
    t.string   "food_date",   limit: 191
    t.integer  "employ_id",   limit: 8
    t.integer  "source",      limit: 2
    t.integer  "nums",        limit: 8
    t.integer  "cancel_nums", limit: 8
    t.boolean  "single"
    t.integer  "total",       limit: 8
    t.string   "employ_name", limit: 191
    t.integer  "food_buy_id", limit: 8
    t.integer  "status",      limit: 8
  end

  create_table "employs", force: :cascade do |t|
    t.string   "mobile",     limit: 100
    t.string   "user_name",  limit: 100
    t.datetime "created_at",             precision: 3
    t.datetime "updated_at",             precision: 3
    t.integer  "wx_user_id", limit: 8
  end

  create_table "express_companys", force: :cascade do |t|
    t.string   "express_code",    limit: 128, default: "", null: false
    t.string   "express_company", limit: 128, default: "", null: false
    t.datetime "create_time",                              null: false
    t.datetime "update_time",                              null: false
  end

  create_table "file_users", force: :cascade do |t|
    t.datetime "created_at",              precision: 3
    t.datetime "updated_at",              precision: 3
    t.datetime "deleted_at",              precision: 3
    t.integer  "user_id",     limit: 8
    t.integer  "company_id",  limit: 8
    t.string   "type",        limit: 191
    t.string   "name",        limit: 255
    t.boolean  "folder"
    t.integer  "folder_id",   limit: 8
    t.string   "pinyin",      limit: 191
    t.string   "fist_pinyin", limit: 191
    t.integer  "file_id",     limit: 8
  end

  add_index "file_users", ["company_id"], name: "idx_file_users_company_id", using: :btree
  add_index "file_users", ["deleted_at"], name: "idx_file_users_deleted_at", using: :btree
  add_index "file_users", ["file_id"], name: "idx_file_users_file_id", using: :btree
  add_index "file_users", ["fist_pinyin"], name: "idx_file_users_fist_pinyin", using: :btree
  add_index "file_users", ["folder"], name: "idx_file_users_folder", using: :btree
  add_index "file_users", ["folder_id"], name: "idx_file_users_folder_id", using: :btree
  add_index "file_users", ["pinyin"], name: "idx_file_users_pinyin", using: :btree
  add_index "file_users", ["type"], name: "idx_file_users_type", using: :btree
  add_index "file_users", ["user_id"], name: "idx_file_users_user_id", using: :btree

  create_table "files", force: :cascade do |t|
    t.datetime "created_at",             precision: 3
    t.string   "path",       limit: 255
    t.string   "hash",       limit: 191
    t.string   "mime",       limit: 191
    t.string   "ext",        limit: 191
    t.string   "type",       limit: 191
    t.integer  "size",       limit: 8
  end

  add_index "files", ["ext"], name: "idx_files_ext", using: :btree
  add_index "files", ["hash"], name: "idx_files_hash", using: :btree
  add_index "files", ["mime"], name: "idx_files_mime", using: :btree
  add_index "files", ["type"], name: "idx_files_type", using: :btree

  create_table "food_forbid_date", force: :cascade do |t|
    t.date     "forbid_date"
    t.integer  "source",      limit: 4
    t.datetime "created_at",            precision: 3
    t.datetime "updated_at",            precision: 3
  end

  create_table "food_unsubs", force: :cascade do |t|
    t.datetime "created_at",              precision: 3
    t.datetime "updated_at",              precision: 3
    t.string   "food_date",   limit: 191
    t.integer  "source",      limit: 8
    t.integer  "employ_id",   limit: 8
    t.string   "employ_name", limit: 191
    t.integer  "nums",        limit: 8
    t.integer  "total",       limit: 8
    t.string   "remark",      limit: 191
    t.boolean  "status",                                default: false
  end

  create_table "group_message_records", force: :cascade do |t|
    t.integer  "wx_user_id",       limit: 4,   default: 0
    t.string   "mobile",           limit: 64
    t.string   "group_message_id", limit: 128, default: "0"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "flag",             limit: 4,   default: 0,   null: false
  end

  add_index "group_message_records", ["mobile"], name: "idx_mobile", using: :btree

  create_table "group_messages", force: :cascade do |t|
    t.integer  "depart_record_id", limit: 4,   default: 0
    t.string   "code",             limit: 64
    t.string   "name",             limit: 128, default: "0"
    t.string   "keyword1",         limit: 128
    t.string   "keyword2",         limit: 128
    t.string   "keyword3",         limit: 128
    t.integer  "count",            limit: 4
    t.string   "remark",           limit: 128
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "group_messages", ["code"], name: "idx_code", using: :btree

  create_table "invite_benefit_orders", force: :cascade do |t|
    t.integer  "benefit_wx_uid",   limit: 4,                   null: false
    t.integer  "wx_uid",           limit: 4,                   null: false
    t.integer  "ind_wx_uid",       limit: 4,                   null: false
    t.integer  "count",            limit: 4,                   null: false
    t.integer  "amount",           limit: 4,                   null: false
    t.string   "source",           limit: 64
    t.string   "relate_id",        limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_enter_balance",             default: false, null: false
    t.datetime "enter_time"
  end

  add_index "invite_benefit_orders", ["benefit_wx_uid"], name: "index_invite_benefit_orders_on_benefit_wx_uid", using: :btree

  create_table "jwts", force: :cascade do |t|
    t.datetime "created_at",             precision: 3
    t.datetime "expires_at",             precision: 3
    t.integer  "user_id",    limit: 8
    t.string   "uuid",       limit: 255
    t.integer  "company",    limit: 8
  end

  add_index "jwts", ["company"], name: "idx_jwts_company", using: :btree
  add_index "jwts", ["user_id"], name: "idx_jwts_user_id", using: :btree

  create_table "key_word_pushs", force: :cascade do |t|
    t.string   "key_word",           limit: 255
    t.string   "push_type",          limit: 255, null: false
    t.string   "push_title",         limit: 255
    t.string   "cover",              limit: 255
    t.string   "word",               limit: 255
    t.string   "url",                limit: 255
    t.string   "remark",             limit: 255, null: false
    t.integer  "wx_gongzhonghao_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "key_word_pushs", ["key_word"], name: "index_key_word_pushs_on_key_word", using: :btree

  create_table "list_files", force: :cascade do |t|
    t.string   "order_no",       limit: 255
    t.string   "order_status",   limit: 128
    t.datetime "paied_date"
    t.datetime "paied_date_end"
    t.integer  "paied_time",     limit: 4,   default: 0
    t.integer  "depart",         limit: 4,   default: 0
    t.string   "list_file",      limit: 255
    t.boolean  "status",                     default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "line_file",      limit: 128, default: "",    null: false
    t.string   "pdf_file",       limit: 128, default: "",    null: false
  end

  create_table "live_awards", force: :cascade do |t|
    t.string   "openid",     limit: 256
    t.integer  "wx_user_id", limit: 4,   default: 0
    t.string   "remark",     limit: 256
    t.integer  "room_id",    limit: 4,   default: 0
    t.integer  "prod1",      limit: 4,   default: 0
    t.integer  "nums1",      limit: 4,   default: 0
    t.integer  "prod2",      limit: 4,   default: 0
    t.integer  "nums2",      limit: 4,   default: 0
    t.integer  "prod3",      limit: 4,   default: 0
    t.integer  "nums3",      limit: 4,   default: 0
    t.integer  "cash",       limit: 4,   default: 0
    t.integer  "cent",       limit: 4,   default: 0
    t.string   "address",    limit: 256
    t.string   "contact",    limit: 256
    t.string   "tel",        limit: 256
    t.boolean  "status",                 default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "live_awards", ["wx_user_id"], name: "index_live_awards_on_wx_user_id", using: :btree

  create_table "live_broads", force: :cascade do |t|
    t.string   "title",      limit: 128,                 null: false
    t.string   "cover",      limit: 256
    t.integer  "room_id",    limit: 4,   default: 0,     null: false
    t.datetime "begin_time"
    t.datetime "end_time"
    t.boolean  "show",                   default: false
    t.string   "remark",     limit: 256
    t.integer  "recommend",  limit: 4,   default: 0,     null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "rank_strs",  limit: 255, default: ""
  end

  add_index "live_broads", ["room_id"], name: "index_live_broads_on_room_id", using: :btree

  create_table "main_economics", force: :cascade do |t|
    t.integer  "wx_uid",     limit: 4,                   null: false
    t.integer  "cent",       limit: 4,                   null: false
    t.boolean  "is_wrong",               default: false
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "main_economics", ["wx_uid"], name: "index_main_economics_on_wx_uid", using: :btree

  create_table "merchant_user_relations", force: :cascade do |t|
    t.integer  "merchant_id",        limit: 4,                     null: false
    t.integer  "user_id",            limit: 4,                     null: false
    t.boolean  "is_effect",                        default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_super_admin",                   default: false
    t.text     "manage_product_ids", limit: 65535
  end

  add_index "merchant_user_relations", ["merchant_id"], name: "index_merchant_user_relations_on_merchant_id", using: :btree
  add_index "merchant_user_relations", ["user_id"], name: "index_merchant_user_relations_on_user_id", using: :btree

  create_table "merchants", force: :cascade do |t|
    t.integer  "user_id",      limit: 4
    t.string   "name",         limit: 100
    t.string   "contact",      limit: 16
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "tel",          limit: 20
    t.string   "payee",        limit: 64,  null: false
    t.string   "bank_card_no", limit: 64,  null: false
    t.string   "bank_name",    limit: 64,  null: false
    t.string   "back_voucher", limit: 100, null: false
  end

  add_index "merchants", ["user_id"], name: "index_wx_users_on_user_id", using: :btree

  create_table "navigate_icon_configs", force: :cascade do |t|
    t.string  "name",              limit: 10,   default: "",    null: false
    t.integer "sort",              limit: 4,    default: 1,     null: false
    t.string  "url",               limit: 4096, default: "",    null: false
    t.integer "url_type",          limit: 1,    default: 0
    t.string  "cover",             limit: 255
    t.boolean "state",                          default: true,  null: false
    t.string  "remark",            limit: 225,  default: ""
    t.integer "product_cat_index", limit: 4,    default: 0,     null: false
    t.boolean "app_state",                      default: false, null: false
  end

  create_table "order_details", force: :cascade do |t|
    t.string   "order_no",                limit: 200, default: "0"
    t.integer  "product_id",              limit: 4,   default: 0
    t.integer  "nums",                    limit: 4,   default: 0
    t.integer  "unit_robo_balance_price", limit: 4
    t.integer  "price",                   limit: 4,   default: 0
    t.string   "product_name",            limit: 200
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "order_id",                limit: 4,   default: 0
    t.boolean  "is_zeng",                             default: false
    t.boolean  "is_delete"
    t.string   "size_name",               limit: 128
    t.string   "color_name",              limit: 128
    t.integer  "depart",                  limit: 4
    t.boolean  "commend",                             default: false
    t.integer  "relate_product_id",       limit: 4,   default: 0,     null: false
    t.string   "product_no",              limit: 128
    t.integer  "link_flag",               limit: 4,   default: 0
    t.integer  "pv",                      limit: 4,   default: 0
    t.string   "order_status",            limit: 64
    t.integer  "silver",                  limit: 4,   default: 0
    t.integer  "dis_amount",              limit: 4,   default: 0
  end

  add_index "order_details", ["order_id"], name: "index_orderId", using: :btree
  add_index "order_details", ["order_no"], name: "index_orderNo", using: :btree
  add_index "order_details", ["product_id"], name: "index_productId", using: :btree

  create_table "order_refunds", force: :cascade do |t|
    t.string   "order_id",       limit: 128
    t.integer  "wx_user_id",     limit: 4,   default: 0
    t.string   "transaction_id", limit: 256
    t.integer  "total",          limit: 4,   default: 0
    t.integer  "refund_fee",     limit: 4,   default: 0
    t.integer  "refund_time",    limit: 4,   default: 0
    t.boolean  "status",                     default: false
    t.string   "remark",         limit: 128
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "order_refunds", ["order_id"], name: "index_order_refunds_on_order_id", using: :btree

  create_table "order_static_details", force: :cascade do |t|
    t.date     "begin_date"
    t.date     "end_date"
    t.string   "state",        limit: 256
    t.boolean  "is_send",                  default: true
    t.integer  "product_id",   limit: 8,   default: 0
    t.integer  "static_id",    limit: 8,   default: 0
    t.string   "product_name", limit: 256
    t.integer  "nums",         limit: 8,   default: 0
    t.integer  "total",        limit: 4,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "order_statics", force: :cascade do |t|
    t.date     "begin_date"
    t.date     "end_date"
    t.string   "state",      limit: 256
    t.boolean  "is_send",                default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "orders", force: :cascade do |t|
    t.string   "order_id",             limit: 255,                 null: false
    t.integer  "order_type",           limit: 1,   default: 0
    t.integer  "wx_user_id",           limit: 4,   default: 0,     null: false
    t.integer  "user_id",              limit: 4,                   null: false
    t.integer  "total_price",          limit: 4,                   null: false
    t.integer  "paied_price",          limit: 4,   default: 0
    t.integer  "buy_price",            limit: 4,   default: 0
    t.integer  "count",                limit: 4,   default: 0,     null: false
    t.integer  "paied_at",             limit: 4,   default: 0
    t.string   "trade_no",             limit: 255
    t.string   "status",               limit: 255
    t.string   "pay_way",              limit: 255
    t.string   "tel",                  limit: 255
    t.string   "address",              limit: 255
    t.string   "contact",              limit: 255
    t.string   "express_company",      limit: 255
    t.string   "express_order_no",     limit: 255
    t.string   "remark",               limit: 255
    t.datetime "dispatch_time"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "receive_time"
    t.string   "order_remark",         limit: 255
    t.string   "source",               limit: 255, default: "xcx"
    t.integer  "freight",              limit: 4,   default: 0
    t.integer  "calc_flag",            limit: 4,   default: 0,     null: false
    t.datetime "paied_time"
    t.string   "express_code",         limit: 128, default: "",    null: false
    t.integer  "coupon_price",         limit: 4,   default: 0,     null: false
    t.integer  "cent_price",           limit: 4,   default: 0,     null: false
    t.integer  "depart",               limit: 4
    t.integer  "link_flag",            limit: 4,   default: 0
    t.integer  "pv",                   limit: 4,   default: 0
    t.integer  "pick_way",             limit: 4,   default: 0
    t.integer  "pick_dept",            limit: 4,   default: 0
    t.boolean  "has_commission",                   default: false
    t.string   "promotions",           limit: 255
    t.string   "normal_promotions",    limit: 255
    t.string   "not_promotion_amount", limit: 255
    t.integer  "address_id",           limit: 4,   default: 0
    t.integer  "dis_amount",           limit: 4,   default: 0
    t.integer  "total_silver",         limit: 4,   default: 0
    t.integer  "paied_silver",         limit: 4,   default: 0
    t.integer  "paied_cash",           limit: 4,   default: 0
  end

  add_index "orders", ["address"], name: "index_orders_on_address", using: :btree
  add_index "orders", ["depart"], name: "index_orders_on_depart", using: :btree
  add_index "orders", ["order_id"], name: "index_orders_on_order_id", using: :btree
  add_index "orders", ["paied_time"], name: "index_orders_on_paied_at", using: :btree
  add_index "orders", ["user_id"], name: "index_orders_on_user_id", using: :btree
  add_index "orders", ["wx_user_id"], name: "index_orders_on_wx_user_id", using: :btree

  create_table "parent_signup_channels", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.string   "desc",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "pay_configs", force: :cascade do |t|
    t.integer  "depart",     limit: 4,   default: 0, null: false
    t.string   "pay_code",   limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "pay_configs", ["depart"], name: "index_pay_configs_on_depart", using: :btree

  create_table "pick_addresses", force: :cascade do |t|
    t.integer  "wx_user_id", limit: 4
    t.string   "contact",    limit: 255
    t.string   "tel",        limit: 255
    t.string   "remark",     limit: 255
    t.boolean  "state",                  default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "pick_addresses", ["wx_user_id"], name: "index_pick_addresses_on_wx_user_id", using: :btree

  create_table "platform_categories", force: :cascade do |t|
    t.string  "name",       limit: 20,   default: "",   null: false
    t.integer "position",   limit: 4,    default: 1,    null: false
    t.string  "ancestry",   limit: 20,   default: ""
    t.string  "platform",   limit: 20,   default: "",   null: false
    t.string  "url",        limit: 4096, default: "",   null: false
    t.boolean "state",                   default: true, null: false
    t.string  "remark",     limit: 225,  default: "",   null: false
    t.integer "product_id", limit: 4,    default: 0,    null: false
    t.string  "cover",      limit: 255
    t.integer "url_type",   limit: 1,    default: 0
  end

  add_index "platform_categories", ["ancestry"], name: "index_platform_categories_on_ancestry", using: :btree
  add_index "platform_categories", ["platform"], name: "index_platform_categories_on_platform", using: :btree
  add_index "platform_categories", ["position"], name: "index_platform_categories_on_position", using: :btree

  create_table "poster_qrcode_records", force: :cascade do |t|
    t.integer  "wx_uid",           limit: 4,   null: false
    t.integer  "parent_relate_id", limit: 4,   null: false
    t.integer  "relate_id",        limit: 4,   null: false
    t.string   "ptype",            limit: 255
    t.string   "qrcode_url",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "scan_times",       limit: 4,   null: false
  end

  add_index "poster_qrcode_records", ["wx_uid"], name: "index_poster_qrcode_records_on_wx_uid", using: :btree

  create_table "poster_qrcode_scan_records", force: :cascade do |t|
    t.integer  "poster_qrcode_id", limit: 4,  null: false
    t.integer  "wx_uid",           limit: 4,  null: false
    t.string   "ip",               limit: 32
    t.integer  "scan_times",       limit: 4,  null: false
    t.datetime "scan_last_time"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "poster_qrcode_scan_records", ["poster_qrcode_id"], name: "index_poster_qrcode_scan_records_on_poster_qrcode_id", using: :btree
  add_index "poster_qrcode_scan_records", ["wx_uid", "poster_qrcode_id"], name: "index_poster_qrcode_scan_records_on_wx_uid_and_poster_qrcode_id", unique: true, using: :btree
  add_index "poster_qrcode_scan_records", ["wx_uid"], name: "index_poster_qrcode_scan_records_on_wx_uid", using: :btree

  create_table "presents", force: :cascade do |t|
    t.integer  "wx_user_id", limit: 4,   default: 0
    t.integer  "price",      limit: 4,   default: 0
    t.integer  "total",      limit: 4,   default: 0
    t.integer  "send_prod1", limit: 4,   default: 0
    t.integer  "send_nums1", limit: 4,   default: 0
    t.boolean  "status",                 default: false
    t.string   "order_id",   limit: 64
    t.string   "source",     limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "presents", ["order_id"], name: "index_presents_on_order_id", using: :btree
  add_index "presents", ["wx_user_id"], name: "index_presents_on_wx_user_id", using: :btree

  create_table "product_attr_configs", force: :cascade do |t|
    t.integer  "product_id",  limit: 8,  default: 0
    t.integer  "attr_key_id", limit: 8,  default: 0
    t.string   "size_type",   limit: 64
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "product_attr_configs", ["attr_key_id"], name: "index_product_attr_configs_on_attr_key_id", using: :btree
  add_index "product_attr_configs", ["product_id"], name: "index_product_attr_configs_on_product_id", using: :btree

  create_table "product_attr_keys", force: :cascade do |t|
    t.string   "name",       limit: 128
    t.boolean  "status",                 default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "product_attrs", force: :cascade do |t|
    t.integer  "attr_key_id", limit: 8,   default: 0
    t.string   "name",        limit: 500
    t.integer  "recommend",   limit: 8,   default: 0
    t.boolean  "status",                  default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "product_attrs", ["attr_key_id"], name: "index_product_attrs_on_attr_key_id", using: :btree

  create_table "product_cats", force: :cascade do |t|
    t.string  "name",      limit: 20,                 null: false
    t.integer "position",  limit: 4
    t.string  "ancestry",  limit: 20
    t.boolean "status",               default: true
    t.boolean "cow_state",            default: false
  end

  add_index "product_cats", ["ancestry"], name: "index_product_cats_on_ancestry", using: :btree
  add_index "product_cats", ["name"], name: "index_product_cats_on_name", using: :btree
  add_index "product_cats", ["position"], name: "index_product_cats_on_position", using: :btree

  create_table "product_commends", force: :cascade do |t|
    t.integer  "wx_user_id", limit: 4,   default: 0,     null: false
    t.integer  "product_id", limit: 4,   default: 0,     null: false
    t.string   "order_id",   limit: 256
    t.string   "detail",     limit: 256
    t.integer  "score",      limit: 4,   default: 0,     null: false
    t.boolean  "is_enable",              default: false
    t.boolean  "is_top",                 default: false
    t.integer  "recommend",  limit: 4,   default: 0,     null: false
    t.string   "remark",     limit: 256
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "product_commends", ["product_id"], name: "index_product_commends_on_product_id", using: :btree
  add_index "product_commends", ["wx_user_id"], name: "index_product_commends_on_wx_user_id", using: :btree

  create_table "product_items", force: :cascade do |t|
    t.integer  "product_id", limit: 4,   default: 0
    t.string   "title",      limit: 255
    t.integer  "item_id",    limit: 4,   default: 0
    t.string   "item_title", limit: 255
    t.integer  "nums",       limit: 4,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "product_pictures", force: :cascade do |t|
    t.string   "product_id", limit: 20,              null: false
    t.string   "img",        limit: 255,             null: false
    t.integer  "pic_type",   limit: 1,   default: 0
    t.integer  "sort",       limit: 4,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "product_pictures", ["product_id"], name: "index_pictures_on_product_id", using: :btree

  create_table "product_sale_subjects", force: :cascade do |t|
    t.string   "product_ids",     limit: 255,                   null: false
    t.string   "background_img",  limit: 255
    t.string   "subject_title",   limit: 255,                   null: false
    t.text     "subject_desc",    limit: 65535,                 null: false
    t.string   "qrcode_tips",     limit: 255
    t.string   "qrcode_img",      limit: 255
    t.string   "share_title",     limit: 50
    t.string   "share_content",   limit: 50
    t.string   "share_img",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_prize_act",                  default: false, null: false
    t.datetime "open_prize_time"
    t.string   "prize_number",    limit: 20
    t.string   "rule",            limit: 255
    t.string   "prize_name",      limit: 50
    t.integer  "click",           limit: 4,     default: 0
  end

  create_table "product_sale_types", force: :cascade do |t|
    t.string   "name",       limit: 128
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "product_warns", force: :cascade do |t|
    t.date     "happen_time"
    t.integer  "product_id",        limit: 4,   default: 0,  null: false
    t.string   "product_name",      limit: 128, default: "", null: false
    t.string   "product_type",      limit: 128, default: "", null: false
    t.string   "product_size",      limit: 128, default: "", null: false
    t.integer  "sale_90",           limit: 4,   default: 0,  null: false
    t.integer  "sale_30",           limit: 4,   default: 0,  null: false
    t.integer  "sale_10",           limit: 4,   default: 0,  null: false
    t.integer  "now_count",         limit: 4,   default: 0,  null: false
    t.integer  "product_cycle",     limit: 4,   default: 0,  null: false
    t.integer  "stock_cycle",       limit: 4,   default: 0,  null: false
    t.integer  "min_purchase",      limit: 4,   default: 0,  null: false
    t.integer  "history_day_sales", limit: 4,   default: 0,  null: false
    t.integer  "recommend_count",   limit: 4,   default: 0,  null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "products", force: :cascade do |t|
    t.string   "name",                 limit: 100,                                 null: false
    t.integer  "category_id",          limit: 4
    t.text     "detail",               limit: 65535,                               null: false
    t.integer  "price",                limit: 4,                                   null: false
    t.integer  "robo_balance_price",   limit: 4,                                   null: false
    t.integer  "mall_balance_price",   limit: 4
    t.string   "ptype",                limit: 32,    default: "direct_sale",       null: false
    t.integer  "buy_price",            limit: 4,                                   null: false
    t.integer  "count",                limit: 4,     default: 1,                   null: false
    t.integer  "recommend",            limit: 4,     default: 0
    t.boolean  "status",                             default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "merchant_id",          limit: 4
    t.boolean  "is_support_poor",                    default: false
    t.integer  "virtual_sold_count",   limit: 4,     default: 0
    t.integer  "purchase_limit_count", limit: 4,     default: 0,                   null: false
    t.integer  "single_purch_limit",   limit: 4,     default: 0,                   null: false
    t.integer  "user_sale_price",      limit: 4,     default: 0,                   null: false
    t.string   "share_content",        limit: 50
    t.string   "share_img",            limit: 255
    t.datetime "seckill_start"
    t.datetime "seckill_end"
    t.integer  "seckill_price",        limit: 4
    t.datetime "deliver_stop_at"
    t.datetime "deliver_start_at"
    t.boolean  "is_only_new",                        default: false
    t.string   "specification",        limit: 255
    t.string   "no_delivery_area",     limit: 255,   default: "西藏、新疆、内蒙、宁夏、青海、甘肃"
    t.boolean  "video_state",                        default: false
    t.string   "video_url",            limit: 100
    t.integer  "sale_nums",            limit: 4,     default: 1,                   null: false
    t.integer  "size_id",              limit: 4,     default: 0,                   null: false
    t.integer  "color_id",             limit: 4,     default: 0,                   null: false
    t.integer  "relate_product_id",    limit: 4
    t.boolean  "show_flag",                          default: false
    t.boolean  "live",                               default: false
    t.boolean  "package",                            default: false
    t.integer  "product_cycle",        limit: 4,     default: 0,                   null: false
    t.integer  "stock_cycle",          limit: 4,     default: 0,                   null: false
    t.integer  "min_purchase",         limit: 4,     default: 0,                   null: false
    t.string   "product_no",           limit: 128,   default: "",                  null: false
    t.integer  "pv",                   limit: 4,     default: 0
    t.integer  "out_nums",             limit: 4,     default: 0
    t.string   "key_words",            limit: 255,   default: "0"
    t.string   "only_delivery_area",   limit: 255,   default: ""
    t.integer  "silver",               limit: 4,     default: 0
    t.boolean  "use_quan"
    t.integer  "sale_zone",            limit: 8,     default: 0
    t.boolean  "allow_app",                          default: false,               null: false
    t.string   "name_en",              limit: 255
    t.string   "name_ru",              limit: 255
    t.string   "name_tw",              limit: 255
    t.text     "detail_en",            limit: 65535
    t.text     "detail_ru",            limit: 65535
    t.text     "detail_tw",            limit: 65535
  end

  add_index "products", ["allow_app"], name: "index_products_on_allow_app", using: :btree
  add_index "products", ["category_id"], name: "index_products_on_category_id", using: :btree
  add_index "products", ["color_id"], name: "index_products_on_color_id", using: :btree
  add_index "products", ["recommend"], name: "Recommend", using: :btree
  add_index "products", ["size_id"], name: "index_products_on_size_id", using: :btree

  create_table "products_promotions", force: :cascade do |t|
    t.integer "promotion_id", limit: 4
    t.integer "product_id",   limit: 4
  end

  add_index "products_promotions", ["promotion_id", "product_id"], name: "idx_pomotion_products_id", using: :btree

  create_table "profit_users", force: :cascade do |t|
    t.integer  "wx_user_id", limit: 4,   default: 0, null: false
    t.string   "openid",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "profit_users", ["wx_user_id"], name: "index_profit_users_on_wx_user_id", using: :btree

  create_table "promotions", force: :cascade do |t|
    t.string   "name",       limit: 128
    t.datetime "begin_time"
    t.datetime "end_time"
    t.boolean  "is_first",               default: true
    t.boolean  "is_more",                default: true
    t.integer  "order_type", limit: 4,   default: 0
    t.integer  "cash",       limit: 4
    t.integer  "cent",       limit: 4
    t.integer  "min_total",  limit: 4,   default: 0
    t.integer  "max_total",  limit: 4,   default: 0
    t.integer  "prod1",      limit: 4,   default: 0
    t.integer  "nums1",      limit: 4,   default: 0
    t.integer  "prod2",      limit: 4,   default: 0
    t.integer  "nums2",      limit: 4,   default: 0
    t.integer  "prod3",      limit: 4,   default: 0
    t.integer  "nums3",      limit: 4,   default: 0
    t.integer  "send_prod1", limit: 4,   default: 0
    t.integer  "send_nums1", limit: 4,   default: 0
    t.integer  "send_prod2", limit: 4,   default: 0
    t.integer  "send_nums2", limit: 4,   default: 0
    t.integer  "send_prod3", limit: 4,   default: 0
    t.integer  "send_nums3", limit: 4,   default: 0
    t.boolean  "is_enable",              default: true
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "prod4",      limit: 4
    t.integer  "nums4",      limit: 4
    t.integer  "prod5",      limit: 4
    t.integer  "nums5",      limit: 4
    t.integer  "send_prod4", limit: 4
    t.integer  "send_nums4", limit: 4
    t.integer  "send_prod5", limit: 4
    t.integer  "send_nums5", limit: 4
    t.integer  "depart",     limit: 4,   default: 0,    null: false
  end

  add_index "promotions", ["begin_time"], name: "index_promotions_on_begin_time", using: :btree
  add_index "promotions", ["end_time"], name: "index_promotions_on_end_time", using: :btree

  create_table "push_after_subs", force: :cascade do |t|
    t.string   "push_type",  limit: 255,   null: false
    t.string   "push_title", limit: 255
    t.string   "cover",      limit: 255
    t.text     "word",       limit: 65535
    t.string   "url",        limit: 255
    t.string   "remark",     limit: 255,   null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "push_tmpl_records", force: :cascade do |t|
    t.integer  "wx_uid",    limit: 4, null: false
    t.datetime "push_time",           null: false
    t.integer  "temp_id",   limit: 4, null: false
  end

  add_index "push_tmpl_records", ["wx_uid"], name: "index_push_tmpl_records_on_wx_uid", using: :btree

  create_table "push_tmpls", force: :cascade do |t|
    t.text     "user_id",            limit: 65535
    t.string   "msg_type",           limit: 255
    t.boolean  "push_force",                       default: false
    t.integer  "push_count",         limit: 4,     default: 0
    t.integer  "click_count",        limit: 4,     default: 0
    t.string   "first",              limit: 255
    t.string   "keyword1",           limit: 255
    t.string   "keyword2",           limit: 255
    t.string   "keyword3",           limit: 255
    t.string   "keyword4",           limit: 255
    t.string   "keyword5",           limit: 255
    t.string   "remark",             limit: 255
    t.string   "url",                limit: 255
    t.integer  "times",              limit: 4,     default: 0
    t.datetime "last_updated_at"
    t.integer  "wx_gongzhonghao_id", limit: 4,     default: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "rails_admin_histories", force: :cascade do |t|
    t.text     "message",    limit: 65535
    t.string   "username",   limit: 255
    t.integer  "item",       limit: 4
    t.string   "table",      limit: 255
    t.integer  "month",      limit: 2
    t.integer  "year",       limit: 8
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "rails_admin_histories", ["item", "table", "month", "year"], name: "index_rails_admin_histories", using: :btree

  create_table "random_excel", force: :cascade do |t|
    t.string   "user_no",    limit: 256
    t.integer  "rand_id",    limit: 8,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "recharge_cash_orders", force: :cascade do |t|
    t.string   "order_id",             limit: 64,                  null: false
    t.integer  "user_id",              limit: 4,                   null: false
    t.integer  "wx_user_id",           limit: 4
    t.string   "pay_way",              limit: 20
    t.string   "trade_no",             limit: 64
    t.integer  "paied_at",             limit: 4
    t.integer  "total_price",          limit: 8,   default: 0
    t.boolean  "state",                            default: false
    t.string   "remark",               limit: 255
    t.string   "balance_bank_card_no", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "recharge_cash_orders", ["order_id"], name: "index_recharge_cash_orders_on_order_id", using: :btree
  add_index "recharge_cash_orders", ["user_id"], name: "index_recharge_cash_orders_on_user_id", using: :btree
  add_index "recharge_cash_orders", ["wx_user_id"], name: "index_recharge_cash_orders_on_wx_user_id", using: :btree

  create_table "reserve_act_orders", force: :cascade do |t|
    t.integer  "act_id",          limit: 4,                         null: false
    t.string   "order_id",        limit: 255,                       null: false
    t.integer  "total_price",     limit: 8,   default: 0
    t.integer  "paied_price",     limit: 8,   default: 0
    t.integer  "user_id",         limit: 4,                         null: false
    t.string   "pay_way",         limit: 20,  default: "weixinpay"
    t.string   "trade_no",        limit: 64
    t.integer  "paied_at",        limit: 8
    t.boolean  "state",                       default: false
    t.boolean  "is_refunded",                 default: false
    t.boolean  "is_deleted",                  default: false
    t.string   "remark",          limit: 255
    t.integer  "returned_amount", limit: 4,   default: 0
    t.integer  "wx_user_id",      limit: 4,                         null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "reserve_act_orders", ["act_id"], name: "index_reserve_act_orders_on_act_id", using: :btree
  add_index "reserve_act_orders", ["order_id"], name: "index_reserve_act_orders_on_order_id", using: :btree

  create_table "reserve_acts", force: :cascade do |t|
    t.string   "title",             limit: 255,                   null: false
    t.datetime "start_at",                                        null: false
    t.datetime "stop_at",                                         null: false
    t.text     "background_detail", limit: 65535
    t.string   "remark",            limit: 255
    t.string   "guide_url",         limit: 255
    t.string   "guide_text",        limit: 255
    t.string   "url_type",          limit: 20
    t.integer  "state",             limit: 4,     default: 0
    t.string   "share_title",       limit: 255
    t.string   "share_about",       limit: 255
    t.string   "share_img",         limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "join_amount",       limit: 4,     default: 0
    t.string   "rule",              limit: 255
    t.boolean  "is_returned",                     default: false
    t.integer  "return_count",      limit: 4,     default: 1,     null: false
    t.string   "guide_img",         limit: 255
  end

  create_table "scale_devices", force: :cascade do |t|
    t.integer  "wx_user_id",  limit: 4
    t.string   "mac_addr",    limit: 100
    t.string   "device_name", limit: 100
    t.datetime "created_at",              precision: 3
    t.datetime "updated_at",              precision: 3
    t.datetime "deleted_at",              precision: 3
    t.boolean  "active",                                default: true
  end

  add_index "scale_devices", ["deleted_at"], name: "idx_scale_devices_deleted_at", using: :btree

  create_table "scale_result", force: :cascade do |t|
    t.integer  "wx_user_id", limit: 4
    t.text     "result",     limit: 65535
    t.datetime "created_at",               precision: 3
    t.datetime "updated_at",               precision: 3
    t.datetime "deleted_at",               precision: 3
    t.integer  "user_id",    limit: 8
  end

  add_index "scale_result", ["deleted_at"], name: "idx_scale_result_deleted_at", using: :btree

  create_table "scale_users", force: :cascade do |t|
    t.datetime "created_at",                precision: 3
    t.datetime "updated_at",                precision: 3
    t.integer  "wx_user_id",    limit: 8
    t.integer  "device_id",     limit: 2
    t.integer  "sex",           limit: 2
    t.boolean  "active",                                  default: true
    t.string   "avatar",        limit: 256
    t.string   "nick_name",     limit: 100
    t.string   "height",        limit: 100
    t.string   "weight",        limit: 100,               default: ""
    t.string   "age",           limit: 100
    t.string   "target_weight", limit: 100
    t.string   "birthday",      limit: 191
    t.string   "country",       limit: 50
    t.string   "race",          limit: 50
    t.string   "occupation",    limit: 100
  end

  create_table "session", primary_key: "session_key", force: :cascade do |t|
    t.binary  "session_data",   limit: 65535
    t.integer "session_expiry", limit: 4,     null: false
  end

  create_table "share_infos", force: :cascade do |t|
    t.string   "share_code",        limit: 255,             null: false
    t.string   "relate_id",         limit: 255,             null: false
    t.string   "relate_parent",     limit: 255,             null: false
    t.integer  "wx_user_id",        limit: 4,   default: 0
    t.string   "share_to",          limit: 20,              null: false
    t.string   "ip",                limit: 255,             null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "share_times",       limit: 4,   default: 0
    t.datetime "share_latest_time"
  end

  add_index "share_infos", ["relate_id"], name: "index_share_infos_on_relate_id", using: :btree
  add_index "share_infos", ["relate_parent"], name: "index_share_infos_on_relate_parent", using: :btree
  add_index "share_infos", ["share_code"], name: "index_share_infos_on_share_code", using: :btree

  create_table "share_materials", force: :cascade do |t|
    t.integer  "wx_uid",        limit: 4,                         null: false
    t.string   "image_1st",     limit: 255
    t.string   "image_2nd",     limit: 255
    t.string   "image_3rd",     limit: 255
    t.string   "image_4th",     limit: 255
    t.string   "image_5th",     limit: 255
    t.string   "image_6th",     limit: 255
    t.string   "image_7th",     limit: 255
    t.string   "image_8th",     limit: 255
    t.boolean  "is_published",                default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "image_9th",     limit: 255
    t.string   "m_type",        limit: 20,    default: "product", null: false
    t.integer  "type_id",       limit: 4,                         null: false
    t.text     "material_text", limit: 65535
  end

  add_index "share_materials", ["wx_uid"], name: "index_share_materials_on_wx_uid", using: :btree

  create_table "shop_applications", force: :cascade do |t|
    t.integer  "user_id",    limit: 8,   default: 0
    t.integer  "wx_user_id", limit: 8,   default: 0
    t.string   "nickname",   limit: 255
    t.string   "name",       limit: 255
    t.integer  "mobile",     limit: 8,   default: 0
    t.integer  "total",      limit: 4,   default: 0
    t.string   "address",    limit: 255
    t.string   "remark",     limit: 255
    t.string   "image",      limit: 255
    t.boolean  "status",                 default: true
    t.datetime "pass_time"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "calc_flag",  limit: 4
    t.integer  "depart",     limit: 4
    t.integer  "link_flag",  limit: 4,   default: 0
  end

  add_index "shop_applications", ["depart"], name: "index_shop_applications_on_depart", using: :btree
  add_index "shop_applications", ["pass_time"], name: "index_shop_applicatio_pass_time", using: :btree
  add_index "shop_applications", ["user_id"], name: "index_shop_applications_on_user_id", using: :btree
  add_index "shop_applications", ["wx_user_id"], name: "index_shop_applications_on_wx_user_id", using: :btree

  create_table "shop_promotions", force: :cascade do |t|
    t.string   "name",       limit: 128
    t.datetime "begin_time"
    t.datetime "end_time"
    t.integer  "depart",     limit: 4,   default: 0,    null: false
    t.integer  "total",      limit: 4,   default: 0
    t.integer  "cash",       limit: 4,   default: 0
    t.integer  "cent",       limit: 4,   default: 0
    t.integer  "send_prod1", limit: 4,   default: 0
    t.integer  "send_nums1", limit: 4,   default: 0
    t.integer  "send_prod2", limit: 4,   default: 0
    t.integer  "send_nums2", limit: 4,   default: 0
    t.integer  "send_prod3", limit: 4,   default: 0
    t.integer  "send_nums3", limit: 4,   default: 0
    t.integer  "send_prod4", limit: 4,   default: 0
    t.integer  "send_nums4", limit: 4,   default: 0
    t.integer  "send_prod5", limit: 4,   default: 0
    t.integer  "send_nums5", limit: 4,   default: 0
    t.boolean  "is_enable",              default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "shop_promotions", ["begin_time"], name: "index_shop_promotions_on_begin_time", using: :btree
  add_index "shop_promotions", ["end_time"], name: "index_shop_promotions_on_end_time", using: :btree
  add_index "shop_promotions", ["total"], name: "index_shop_promotions_on_total", using: :btree

  create_table "sign_up_channel_qrcode_results", force: :cascade do |t|
    t.integer  "wx_uid",             limit: 4, default: 0, null: false
    t.integer  "sign_up_channel_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sign_up_channel_qrcode_results", ["sign_up_channel_id"], name: "index_sign_up_channel_qrcode_results_on_sign_up_channel_id", using: :btree
  add_index "sign_up_channel_qrcode_results", ["wx_uid", "sign_up_channel_id"], name: "idx_su_cq_result_wxuid_and_channel_id", unique: true, using: :btree
  add_index "sign_up_channel_qrcode_results", ["wx_uid"], name: "index_sign_up_channel_qrcode_results_on_wx_uid", using: :btree

  create_table "sign_up_channels", force: :cascade do |t|
    t.integer  "parent_id",     limit: 4,   default: 0, null: false
    t.string   "channel_value", limit: 255
    t.string   "channel_url",   limit: 255
    t.datetime "created_at",                            null: false
    t.datetime "updated_at",                            null: false
    t.string   "url_image",     limit: 255
    t.integer  "scan_times",    limit: 4,   default: 0, null: false
    t.integer  "invite_id",     limit: 4,   default: 0
  end

  create_table "silvers", force: :cascade do |t|
    t.integer  "user_id",    limit: 4
    t.integer  "wx_user_id", limit: 4
    t.integer  "count",      limit: 4
    t.string   "source",     limit: 64
    t.string   "relate_id",  limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "silvers", ["user_id"], name: "index_silvers_on_user_id", using: :btree
  add_index "silvers", ["wx_user_id"], name: "index_silvers_on_wx_user_id", using: :btree

  create_table "static_foods", force: :cascade do |t|
    t.datetime "created_at",               precision: 3
    t.datetime "updated_at",               precision: 3
    t.string   "food_date",    limit: 191
    t.integer  "source",       limit: 2
    t.integer  "nums",         limit: 8
    t.integer  "pre_nums",     limit: 8
    t.integer  "single_nums",  limit: 8
    t.integer  "total",        limit: 8
    t.integer  "comfirm_nums", limit: 8
  end

  create_table "store_records", force: :cascade do |t|
    t.datetime "date_time"
    t.string   "no",         limit: 255
    t.integer  "product_id", limit: 4,   default: 0, null: false
    t.integer  "order_type", limit: 4,   default: 0, null: false
    t.integer  "nums",       limit: 4,   default: 0, null: false
    t.string   "operator",   limit: 255
    t.string   "remark",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "string_job_baks", force: :cascade do |t|
    t.string   "random_string", limit: 128
    t.string   "qr_string",     limit: 255
    t.datetime "created_at",                precision: 6, null: false
    t.datetime "updated_at",                precision: 6, null: false
  end

  add_index "string_job_baks", ["random_string"], name: "index_string_jobs_on_random_string", unique: true, using: :btree

  create_table "string_jobs", force: :cascade do |t|
    t.string   "random_string", limit: 128
    t.string   "qr_string",     limit: 255
    t.datetime "created_at",                precision: 6, null: false
    t.datetime "updated_at",                precision: 6, null: false
  end

  add_index "string_jobs", ["random_string"], name: "index_string_jobs_on_random_string", unique: true, using: :btree

  create_table "sys_cents", force: :cascade do |t|
    t.integer "user_id", limit: 4, null: false
    t.integer "cent",    limit: 4, null: false
    t.integer "balance", limit: 4, null: false
    t.integer "cash",    limit: 4, null: false
  end

  add_index "sys_cents", ["user_id"], name: "index_sys_cents_on_user_id", using: :btree

  create_table "sys_configs", force: :cascade do |t|
    t.string   "code",             limit: 64
    t.integer  "config_type",      limit: 4,   default: 0
    t.string   "code_value",       limit: 64
    t.integer  "sort",             limit: 4,   default: 0
    t.integer  "depart_record_id", limit: 4,   default: 0
    t.string   "descrption",       limit: 128
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sys_configs", ["code"], name: "idx_code", using: :btree

  create_table "sys_users", force: :cascade do |t|
    t.integer  "invite_id",        limit: 4,                   null: false
    t.string   "user_no",          limit: 128
    t.string   "invite_no",        limit: 128
    t.string   "dengji",           limit: 128
    t.boolean  "show_invite_mode",             default: false
    t.integer  "rank",             limit: 4,                   null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sys_users", ["invite_id"], name: "index_sys_users_on_invite_id", using: :btree

  create_table "take_cash_orders", force: :cascade do |t|
    t.integer  "wx_uid",       limit: 4,                null: false
    t.string   "order_id",     limit: 64,               null: false
    t.string   "trade_no",     limit: 64
    t.integer  "count",        limit: 8,   default: 0
    t.integer  "pay_state",    limit: 1,   default: 0
    t.integer  "audit_state",  limit: 1,   default: 0
    t.integer  "paied_at",     limit: 4
    t.string   "remark",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "expc_pay_at"
    t.string   "account_name", limit: 200
    t.string   "bank_account", limit: 200, default: "", null: false
    t.string   "bank_name",    limit: 200
    t.integer  "real_state",   limit: 4
    t.integer  "user_id",      limit: 4
    t.string   "tel",          limit: 255
    t.integer  "fee",          limit: 4,   default: 0
    t.integer  "fei_count",    limit: 4,   default: 0
    t.integer  "free_count",   limit: 4,   default: 0
  end

  add_index "take_cash_orders", ["order_id"], name: "index_take_cash_orders_on_order_id", using: :btree
  add_index "take_cash_orders", ["wx_uid"], name: "index_take_cash_orders_on_wx_uid", using: :btree

  create_table "tcm_exam_messages", force: :cascade do |t|
    t.datetime "created_at",                      precision: 3
    t.datetime "updated_at",                      precision: 3
    t.integer  "exam_id",      limit: 8
    t.integer  "wx_user_id",   limit: 8
    t.string   "role",         limit: 16
    t.string   "message_type", limit: 32
    t.text     "content",      limit: 4294967295
    t.text     "metadata",     limit: 4294967295
  end

  add_index "tcm_exam_messages", ["exam_id"], name: "idx_tcm_exam_messages_exam", using: :btree
  add_index "tcm_exam_messages", ["exam_id"], name: "idx_tcm_exam_messages_exam_id", using: :btree
  add_index "tcm_exam_messages", ["wx_user_id"], name: "idx_tcm_exam_messages_wx_user", using: :btree
  add_index "tcm_exam_messages", ["wx_user_id"], name: "idx_tcm_exam_messages_wx_user_id", using: :btree

  create_table "tcm_exams", force: :cascade do |t|
    t.datetime "created_at",                             precision: 3
    t.datetime "updated_at",                             precision: 3
    t.integer  "wx_user_id",          limit: 8
    t.integer  "scale_user_id",       limit: 8
    t.string   "model",               limit: 64,                       default: "gemini-3-pro-preview"
    t.string   "status",              limit: 32,                       default: "pending"
    t.text     "question_answers",    limit: 4294967295
    t.text     "observation_images",  limit: 4294967295
    t.text     "latest_scale_result", limit: 4294967295
    t.text     "extra_note",          limit: 4294967295
    t.text     "ai_summary",          limit: 4294967295
    t.text     "report_html",         limit: 4294967295
    t.string   "language",            limit: 16,                       default: "zh"
    t.text     "raw_request",         limit: 65535
  end

  add_index "tcm_exams", ["scale_user_id"], name: "idx_tcm_exams_scale_user", using: :btree
  add_index "tcm_exams", ["scale_user_id"], name: "idx_tcm_exams_scale_user_id", using: :btree
  add_index "tcm_exams", ["wx_user_id"], name: "idx_tcm_exams_wx_user", using: :btree
  add_index "tcm_exams", ["wx_user_id"], name: "idx_tcm_exams_wx_user_id", using: :btree

  create_table "three_wx_users", force: :cascade do |t|
    t.integer  "invite_id",        limit: 4,     default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "intro_inner_no",   limit: 65535
    t.string   "intro_area",       limit: 30
    t.integer  "invite_rank",      limit: 4
    t.integer  "depart",           limit: 4,     default: 0, null: false
    t.integer  "show_invite_mode", limit: 4,     default: 0
    t.integer  "intro_user_Id",    limit: 4,     default: 0
  end

  add_index "three_wx_users", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  add_index "three_wx_users", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  add_index "three_wx_users", ["invite_rank"], name: "index_wx_users_on_invite_rank", using: :btree

  create_table "update_orders", force: :cascade do |t|
    t.string   "order_id",         limit: 256
    t.string   "express_order_no", limit: 256
    t.string   "express_company",  limit: 256
    t.boolean  "status",                       default: true
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "user_perfomances", force: :cascade do |t|
    t.datetime "begin_date"
    t.datetime "end_date"
    t.integer  "wx_user_id",            limit: 4,   default: 0
    t.string   "nickname",              limit: 256
    t.integer  "order_perfomance",      limit: 4,   default: 0
    t.integer  "shop_order_perfomance", limit: 4,   default: 0
    t.integer  "shop_perfomance",       limit: 4,   default: 0
    t.integer  "balance_perfomance",    limit: 4,   default: 0
    t.integer  "total",                 limit: 4,   default: 0
    t.integer  "nums",                  limit: 4,   default: 0, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "user_perfomances", ["wx_user_id"], name: "index_user_perfomances_on_wx_user_id", using: :btree

  create_table "user_tokens", force: :cascade do |t|
    t.integer  "user_id",     limit: 4,               null: false
    t.string   "token",       limit: 255,             null: false
    t.integer  "expire_time", limit: 4,   default: 0, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "user_tokens", ["user_id"], name: "index_user_tokens_on_user_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "tel",               limit: 20
    t.string   "country_code",      limit: 10,  default: "86",  null: false
    t.string   "email",             limit: 191
    t.string   "trade_pwd",         limit: 255, default: "",    null: false
    t.string   "pwd",               limit: 255, default: ""
    t.string   "real_name",         limit: 64
    t.string   "identity_card",     limit: 18
    t.boolean  "is_certification",              default: false
    t.date     "birthday"
    t.string   "nickname",          limit: 100
    t.string   "city",              limit: 20
    t.string   "country",           limit: 20
    t.string   "province",          limit: 20
    t.integer  "sex",               limit: 1,   default: 0
    t.integer  "age",               limit: 4
    t.string   "head",              limit: 255
    t.integer  "invite_id",         limit: 4
    t.integer  "signup_channel_id", limit: 4,   default: 0,     null: false
    t.string   "signup_ip",         limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_black_user",                 default: false
    t.string   "bank_name",         limit: 200
    t.string   "bank_account",      limit: 200
    t.string   "account_name",      limit: 200
    t.string   "race",              limit: 32
    t.string   "occupation",        limit: 100
  end

  add_index "users", ["invite_id"], name: "index_users_on_invite_id", using: :btree

  create_table "users_backup", force: :cascade do |t|
    t.string   "tel",               limit: 20
    t.string   "trade_pwd",         limit: 255, default: "",    null: false
    t.string   "pwd",               limit: 255, default: ""
    t.string   "real_name",         limit: 64
    t.string   "identity_card",     limit: 18
    t.boolean  "is_certification",              default: false
    t.date     "birthday"
    t.string   "nickname",          limit: 100
    t.string   "city",              limit: 20
    t.string   "country",           limit: 20
    t.string   "province",          limit: 20
    t.integer  "sex",               limit: 1,   default: 0
    t.integer  "age",               limit: 4
    t.string   "head",              limit: 255
    t.integer  "invite_id",         limit: 4
    t.integer  "signup_channel_id", limit: 4,   default: 0,     null: false
    t.string   "signup_ip",         limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "is_black_user",                 default: false
    t.string   "bank_name",         limit: 200
    t.string   "bank_account",      limit: 200
    t.string   "account_name",      limit: 200
  end

  add_index "users_backup", ["invite_id"], name: "index_users_on_invite_id", using: :btree

  create_table "version_associations", force: :cascade do |t|
    t.integer "version_id",       limit: 4
    t.string  "foreign_key_name", limit: 255, null: false
    t.integer "foreign_key_id",   limit: 4
  end

  add_index "version_associations", ["foreign_key_name", "foreign_key_id"], name: "index_version_associations_on_foreign_key", using: :btree
  add_index "version_associations", ["version_id"], name: "index_version_associations_on_version_id", using: :btree

  create_table "versions", force: :cascade do |t|
    t.string   "item_type",      limit: 191,        null: false
    t.integer  "item_id",        limit: 4,          null: false
    t.string   "event",          limit: 255,        null: false
    t.string   "whodunnit",      limit: 255
    t.text     "object",         limit: 4294967295
    t.datetime "created_at"
    t.text     "object_changes", limit: 4294967295
    t.integer  "transaction_id", limit: 4
  end

  add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
  add_index "versions", ["transaction_id"], name: "index_versions_on_transaction_id", using: :btree

  create_table "welfare_orders", force: :cascade do |t|
    t.integer  "welfare_id",    limit: 4,               null: false
    t.integer  "product_id",    limit: 4,               null: false
    t.string   "order_id",      limit: 255,             null: false
    t.integer  "wx_uid",        limit: 4,               null: false
    t.integer  "total_price",   limit: 4,               null: false
    t.integer  "paied_price",   limit: 4,   default: 0
    t.integer  "paied_at",      limit: 4
    t.integer  "state",         limit: 1,   default: 0
    t.string   "trade_no",      limit: 255
    t.string   "remark",        limit: 255
    t.integer  "invite_wx_uid", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "welfare_orders", ["order_id"], name: "index_welfare_orders_on_order_id", using: :btree
  add_index "welfare_orders", ["welfare_id"], name: "index_welfare_orders_on_welfare_id", using: :btree
  add_index "welfare_orders", ["wx_uid"], name: "index_welfare_orders_on_wx_uid", using: :btree

  create_table "wx_event_items", force: :cascade do |t|
    t.integer "article_id",  limit: 4,                   null: false
    t.string  "name",        limit: 100,                 null: false
    t.string  "title",       limit: 255
    t.boolean "use_title",               default: false
    t.string  "cover",       limit: 255
    t.boolean "use_cover",               default: false
    t.string  "href",        limit: 255
    t.boolean "use_href",                default: false
    t.integer "position",    limit: 4
    t.integer "click_times", limit: 4
    t.string  "ancestry",    limit: 100
    t.boolean "state",                   default: false
  end

  add_index "wx_event_items", ["ancestry"], name: "index_wx_event_items_on_ancestry", using: :btree

  create_table "wx_events", force: :cascade do |t|
    t.integer  "wx_gongzhonghao_id",  limit: 4,                     null: false
    t.string   "return_type",         limit: 4,                     null: false
    t.string   "key",                 limit: 255
    t.integer  "wx_event_item_id",    limit: 4
    t.text     "return_text_content", limit: 65535
    t.boolean  "state",                             default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "wx_events", ["key"], name: "index_wx_events_on_key", using: :btree
  add_index "wx_events", ["wx_gongzhonghao_id"], name: "index_wx_events_on_wx_gongzhonghao_id", using: :btree

  create_table "wx_form_ids", force: :cascade do |t|
    t.string   "mp_openid",  limit: 128
    t.string   "openid",     limit: 128
    t.string   "form_id",    limit: 100
    t.boolean  "state",                  default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "wx_form_ids", ["form_id"], name: "form_id", unique: true, using: :btree

  create_table "wx_gongzhonghaos", force: :cascade do |t|
    t.string   "wx_hao",          limit: 255,                       null: false
    t.string   "wx_name",         limit: 255,                       null: false
    t.string   "wx_type",         limit: 9,     default: "service", null: false
    t.boolean  "is_authed",                     default: false
    t.string   "app_id",          limit: 255,                       null: false
    t.string   "app_secret",      limit: 255
    t.string   "token",           limit: 255
    t.text     "sub_return_text", limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "wx_gongzhonghaos", ["app_id"], name: "index_wx_gongzhonghaos_on_app_id", unique: true, using: :btree
  add_index "wx_gongzhonghaos", ["wx_hao"], name: "index_wx_gongzhonghaos_on_wx_hao", unique: true, using: :btree

  create_table "wx_menus", force: :cascade do |t|
    t.integer  "wx_gongzhonghao_id", limit: 4,                      null: false
    t.string   "name",               limit: 255
    t.string   "ancestry",           limit: 64
    t.text     "content",            limit: 65535
    t.string   "action",             limit: 15,    default: "view"
    t.datetime "created_at"
    t.string   "key",                limit: 255
    t.integer  "position",           limit: 4
    t.string   "appid",              limit: 255
    t.string   "pagepath",           limit: 255
  end

  add_index "wx_menus", ["ancestry"], name: "index_wx_menus_on_ancestry", using: :btree
  add_index "wx_menus", ["wx_gongzhonghao_id"], name: "index_wx_menus_on_wx_gongzhonghao_id", using: :btree

  create_table "wx_user_gongzhonghaos", force: :cascade do |t|
    t.integer  "wx_user_id",           limit: 4,   null: false
    t.string   "app_id",               limit: 255, null: false
    t.string   "gzh_open_id",          limit: 64
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "subscribe"
    t.integer  "subscribe_time",       limit: 4
    t.integer  "unsubscribe_time",     limit: 4
    t.integer  "last_conversation_at", limit: 4
  end

  add_index "wx_user_gongzhonghaos", ["app_id"], name: "index_wx_user_gongzhonghaos_on_app_id", using: :btree
  add_index "wx_user_gongzhonghaos", ["gzh_open_id"], name: "index_wx_user_gongzhonghaos_on_gzh_open_id", using: :btree
  add_index "wx_user_gongzhonghaos", ["wx_user_id"], name: "index_wx_user_gongzhonghaos_on_wx_user_id", unique: true, using: :btree

  create_table "wx_user_rank", force: :cascade do |t|
    t.datetime "created_at",             precision: 3
    t.datetime "updated_at",             precision: 3
    t.integer  "rank",        limit: 8,                             null: false
    t.string   "rank_name",   limit: 64,               default: "", null: false
    t.integer  "quota_5h",    limit: 8,                default: 0,  null: false
    t.integer  "quota_month", limit: 8,                default: 0,  null: false
  end

  add_index "wx_user_rank", ["rank"], name: "idx_wx_user_rank_rank", unique: true, using: :btree

  create_table "wx_users", force: :cascade do |t|
    t.integer  "user_id",              limit: 4
    t.integer  "invite_id",            limit: 4,                              default: 0
    t.string   "mp_openid",            limit: 64
    t.string   "openid",               limit: 255
    t.string   "nickname",             limit: 100
    t.string   "unionid",              limit: 64
    t.string   "city",                 limit: 20
    t.string   "country",              limit: 20
    t.string   "province",             limit: 20
    t.integer  "sex",                  limit: 1,                              default: 0
    t.string   "head",                 limit: 255
    t.boolean  "subscribe"
    t.boolean  "is_regist",                                                   default: false
    t.integer  "subscribe_time",       limit: 4,                              default: 0
    t.integer  "unsubscribe_time",     limit: 4,                              default: 0
    t.integer  "last_conversation_at", limit: 4,                              default: 0
    t.integer  "channel_qrcode_id",    limit: 4
    t.string   "signup_ip",            limit: 255
    t.string   "invite_qrcode_url",    limit: 255
    t.boolean  "show_invite_mode",                                            default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "intro_user_id",        limit: 4
    t.text     "intro_inner_no",       limit: 65535
    t.string   "intro_area",           limit: 3
    t.integer  "depth",                limit: 4,                              default: 0,     null: false
    t.decimal  "sale_group",                         precision: 20, scale: 2,                 null: false
    t.decimal  "sale_group_sum",                     precision: 20, scale: 2,                 null: false
    t.decimal  "sale_score",                         precision: 20, scale: 2
    t.decimal  "sale_person",                        precision: 20, scale: 2
    t.integer  "active_nums",          limit: 4
    t.integer  "rank",                 limit: 8,                              default: 0
    t.integer  "partner_time",         limit: 4,                              default: 0,     null: false
    t.string   "user_no",              limit: 128
    t.integer  "depart",               limit: 4
    t.string   "tel",                  limit: 20
    t.decimal  "sale_shop",                          precision: 20, scale: 2
    t.decimal  "sale_shop_sum",                      precision: 20, scale: 2
    t.decimal  "sale_6",                             precision: 20, scale: 2,                 null: false
    t.decimal  "sale_7",                             precision: 20, scale: 2,                 null: false
    t.string   "tc_area",              limit: 255,                            default: ""
    t.integer  "tc_bl",                limit: 4,                              default: 0
    t.integer  "vip_rank",             limit: 4,                              default: 1
    t.datetime "vip_end_date"
  end

  add_index "wx_users", ["depart"], name: "index_wx_users_on_depart", using: :btree
  add_index "wx_users", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  add_index "wx_users", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  add_index "wx_users", ["subscribe"], name: "index_wx_users_on_subscribe", using: :btree
  add_index "wx_users", ["user_id"], name: "index_wx_users_on_user_id", using: :btree

  create_table "wx_users_backup", force: :cascade do |t|
    t.integer  "user_id",              limit: 4
    t.integer  "invite_id",            limit: 4,                              default: 0
    t.string   "mp_openid",            limit: 64
    t.string   "openid",               limit: 64
    t.string   "nickname",             limit: 100
    t.string   "unionid",              limit: 64,                                             null: false
    t.string   "city",                 limit: 20
    t.string   "country",              limit: 20
    t.string   "province",             limit: 20
    t.integer  "sex",                  limit: 1,                              default: 0
    t.string   "head",                 limit: 255
    t.boolean  "subscribe"
    t.boolean  "is_regist",                                                   default: false
    t.integer  "subscribe_time",       limit: 4,                              default: 0
    t.integer  "unsubscribe_time",     limit: 4,                              default: 0
    t.integer  "last_conversation_at", limit: 4,                              default: 0
    t.integer  "channel_qrcode_id",    limit: 4
    t.string   "signup_ip",            limit: 255
    t.string   "invite_qrcode_url",    limit: 255
    t.boolean  "show_invite_mode",                                            default: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "intro_user_id",        limit: 4
    t.text     "intro_inner_no",       limit: 65535
    t.string   "intro_area",           limit: 3
    t.integer  "depth",                limit: 4,                              default: 0,     null: false
    t.decimal  "sale_group",                         precision: 20, scale: 2,                 null: false
    t.decimal  "sale_group_sum",                     precision: 20, scale: 2,                 null: false
    t.decimal  "sale_score",                         precision: 20, scale: 2
    t.decimal  "sale_person",                        precision: 20, scale: 2
    t.integer  "active_nums",          limit: 4
    t.integer  "rank",                 limit: 8,                              default: 0
    t.integer  "partner_time",         limit: 4,                              default: 0,     null: false
    t.string   "user_no",              limit: 128
    t.integer  "depart",               limit: 4
    t.string   "tel",                  limit: 20
    t.decimal  "sale_shop",                          precision: 20, scale: 2
    t.decimal  "sale_shop_sum",                      precision: 20, scale: 2
    t.decimal  "sale_6",                             precision: 20, scale: 2,                 null: false
    t.decimal  "sale_7",                             precision: 20, scale: 2,                 null: false
    t.string   "tc_area",              limit: 255,                            default: ""
    t.integer  "tc_bl",                limit: 4,                              default: 0
  end

  add_index "wx_users_backup", ["channel_qrcode_id"], name: "index_wx_users_on_channel_qrcode_id", using: :btree
  add_index "wx_users_backup", ["depart"], name: "index_wx_users_on_depart", using: :btree
  add_index "wx_users_backup", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  add_index "wx_users_backup", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  add_index "wx_users_backup", ["last_conversation_at"], name: "index_wx_users_on_last_conversation_at", using: :btree
  add_index "wx_users_backup", ["mp_openid"], name: "index_wx_users_on_mp_openid", using: :btree
  add_index "wx_users_backup", ["subscribe"], name: "index_wx_users_on_subscribe", using: :btree
  add_index "wx_users_backup", ["unionid"], name: "index_wx_users_on_unionid", unique: true, using: :btree
  add_index "wx_users_backup", ["user_id"], name: "index_wx_users_on_user_id", using: :btree

  create_table "wxku_commodities", force: :cascade do |t|
    t.integer  "product_id",             limit: 4,                                        null: false
    t.string   "image_info_1",           limit: 255
    t.string   "image_info_2",           limit: 255
    t.string   "image_info_3",           limit: 255
    t.string   "image_info_4",           limit: 255
    t.string   "image_info_5",           limit: 255
    t.string   "category_info",          limit: 255, default: "食品生鲜"
    t.string   "official_category_info", limit: 255, default: "食品生鲜"
    t.string   "url",                    limit: 255, default: "pages/start/start?scene="
    t.string   "title",                  limit: 30
    t.string   "sub_title",              limit: 30
    t.string   "brand",                  limit: 255, default: "拉比兔"
    t.integer  "source",                 limit: 4,   default: 1,                          null: false
    t.string   "desc",                   limit: 300
    t.integer  "min_price",              limit: 4
    t.integer  "max_price",              limit: 4
    t.integer  "min_ori_price",          limit: 4
    t.integer  "max_ori_price",          limit: 4
    t.string   "sale_status",            limit: 255
    t.string   "status_ticket",          limit: 255
    t.integer  "stock",                  limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "wxku_commodities", ["product_id"], name: "index_wxku_commodities_on_product_id", using: :btree

  create_table "xcx_push_tmpl_records", force: :cascade do |t|
    t.integer  "wx_uid",    limit: 4, null: false
    t.datetime "push_time",           null: false
    t.integer  "temp_id",   limit: 4, null: false
  end

  add_index "xcx_push_tmpl_records", ["wx_uid"], name: "index_xcx_push_tmpl_records_on_wx_uid", using: :btree

  create_table "xcx_push_tmpls", force: :cascade do |t|
    t.text     "user_id",          limit: 65535
    t.string   "msg_type",         limit: 255
    t.boolean  "push_force",                     default: false
    t.string   "emphasis_keyword", limit: 255
    t.string   "keyword1",         limit: 255
    t.string   "keyword2",         limit: 255
    t.string   "keyword3",         limit: 255
    t.string   "keyword4",         limit: 255
    t.string   "keyword5",         limit: 255
    t.string   "page",             limit: 255
    t.integer  "times",            limit: 4,     default: 0
    t.datetime "last_updated_at"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "xcx_versions", force: :cascade do |t|
    t.string   "version",    limit: 64,                  null: false
    t.string   "desc",       limit: 255
    t.boolean  "state",                  default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "xcx_versions", ["version"], name: "index_xcx_versions_on_version", unique: true, using: :btree

  create_table "积分资料201130", id: false, force: :cascade do |t|
    t.string "user_id", limit: 255
    t.string "cent",    limit: 255
    t.string "balance", limit: 255
    t.string "cash",    limit: 255
    t.string "f5",      limit: 255
  end

end
