schema.rb 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289
  1. # encoding: UTF-8
  2. # This file is auto-generated from the current state of the database. Instead
  3. # of editing this file, please use the migrations feature of Active Record to
  4. # incrementally modify your database, and then regenerate this schema definition.
  5. #
  6. # Note that this schema.rb definition is the authoritative source for your
  7. # database schema. If you need to create the application database on another
  8. # system, you should be using db:schema:load, not running all the migrations
  9. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  10. # you'll amass, the slower it'll run and the greater likelihood for issues).
  11. #
  12. # It's strongly recommended that you check this file into your version control system.
  13. ActiveRecord::Schema.define(version: 20260325000100) do
  14. create_table "1125_wx_users", force: :cascade do |t|
  15. t.integer "user_id", limit: 4
  16. t.integer "invite_id", limit: 4, default: 0
  17. t.string "mp_openid", limit: 64
  18. t.string "openid", limit: 64
  19. t.string "nickname", limit: 100
  20. t.string "unionid", limit: 64, default: "\"\""
  21. t.string "city", limit: 20
  22. t.string "country", limit: 20
  23. t.string "province", limit: 20
  24. t.integer "sex", limit: 1, default: 0
  25. t.string "head", limit: 255
  26. t.boolean "subscribe"
  27. t.boolean "is_regist", default: false
  28. t.integer "subscribe_time", limit: 4, default: 0
  29. t.integer "unsubscribe_time", limit: 4, default: 0
  30. t.integer "last_conversation_at", limit: 4, default: 0
  31. t.integer "channel_qrcode_id", limit: 4
  32. t.string "signup_ip", limit: 255
  33. t.string "invite_qrcode_url", limit: 255
  34. t.boolean "show_invite_mode", default: false
  35. t.datetime "created_at"
  36. t.datetime "updated_at"
  37. t.integer "intro_user_id", limit: 4
  38. t.text "intro_inner_no", limit: 65535
  39. t.string "intro_area", limit: 2
  40. t.integer "depth", limit: 4, default: 0, null: false
  41. t.decimal "sale_group", precision: 12, scale: 2, default: 0.0, null: false
  42. t.decimal "sale_group_sum", precision: 20, scale: 2, default: 0.0, null: false
  43. t.decimal "sale_score", precision: 12, scale: 2
  44. t.integer "rank", limit: 8, default: 0
  45. t.integer "partner_time", limit: 4, default: 0, null: false
  46. t.string "user_no", limit: 128
  47. end
  48. add_index "1125_wx_users", ["last_conversation_at"], name: "index_1125_wx_users_on_last_conversation_at", using: :btree
  49. add_index "1125_wx_users", ["user_id"], name: "index_1125_wx_users_on_user_id", using: :btree
  50. create_table "ad_item_click_statistics", force: :cascade do |t|
  51. t.integer "ad_item_id", limit: 4, null: false
  52. t.integer "wx_uid", limit: 4, null: false
  53. t.string "ip", limit: 32
  54. t.integer "click_times", limit: 4, null: false
  55. t.datetime "click_last_time"
  56. t.datetime "created_at"
  57. t.datetime "updated_at"
  58. end
  59. add_index "ad_item_click_statistics", ["ad_item_id"], name: "index_ad_item_click_statistics_on_ad_item_id", using: :btree
  60. 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
  61. add_index "ad_item_click_statistics", ["wx_uid"], name: "index_ad_item_click_statistics_on_wx_uid", using: :btree
  62. create_table "ad_item_show_statistics", force: :cascade do |t|
  63. t.integer "ad_item_id", limit: 4, null: false
  64. t.integer "wx_uid", limit: 4, null: false
  65. t.string "ip", limit: 32
  66. t.integer "show_times", limit: 4, null: false
  67. t.datetime "show_last_time"
  68. t.datetime "created_at"
  69. t.datetime "updated_at"
  70. end
  71. add_index "ad_item_show_statistics", ["ad_item_id"], name: "index_ad_item_show_statistics_on_ad_item_id", using: :btree
  72. 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
  73. add_index "ad_item_show_statistics", ["wx_uid"], name: "index_ad_item_show_statistics_on_wx_uid", using: :btree
  74. create_table "ad_items", force: :cascade do |t|
  75. t.integer "ad_position_id", limit: 4, null: false
  76. t.string "name", limit: 255, null: false
  77. t.text "img", limit: 65535, null: false
  78. t.text "click_url", limit: 65535
  79. t.integer "click_times", limit: 4, default: 0
  80. t.integer "show_times", limit: 4, default: 0
  81. t.datetime "expired_at"
  82. t.boolean "state", default: true
  83. t.integer "sort", limit: 4, default: 0
  84. t.datetime "created_at"
  85. t.datetime "updated_at"
  86. t.string "url", limit: 4096, default: ""
  87. t.integer "url_type", limit: 1, default: 0
  88. end
  89. add_index "ad_items", ["ad_position_id"], name: "index_ad_items_on_ad_position_id", using: :btree
  90. add_index "ad_items", ["sort"], name: "index_ad_items_on_sort", using: :btree
  91. create_table "ad_positions", force: :cascade do |t|
  92. t.string "code", limit: 255, null: false
  93. t.string "name", limit: 255, null: false
  94. t.string "remark", limit: 255, null: false
  95. t.integer "click_times", limit: 4, default: 0
  96. t.text "img", limit: 65535, null: false
  97. t.text "click_url", limit: 65535
  98. t.boolean "state", default: true
  99. t.datetime "created_at"
  100. t.datetime "updated_at"
  101. end
  102. add_index "ad_positions", ["click_times"], name: "index_ad_positions_on_click_times", using: :btree
  103. add_index "ad_positions", ["code"], name: "index_ad_positions_on_code", unique: true, using: :btree
  104. create_table "addresses", force: :cascade do |t|
  105. t.integer "user_id", limit: 4
  106. t.string "contact", limit: 255
  107. t.string "tel", limit: 255
  108. t.string "address", limit: 255
  109. t.string "postcode", limit: 255
  110. t.string "province", limit: 255
  111. t.string "city", limit: 255
  112. t.string "district", limit: 255
  113. t.string "remark", limit: 255
  114. t.boolean "state", default: false
  115. t.datetime "created_at"
  116. t.datetime "updated_at"
  117. t.integer "wx_user_id", limit: 4, default: 0, null: false
  118. end
  119. add_index "addresses", ["user_id"], name: "index_addresses_on_user_id", using: :btree
  120. add_index "addresses", ["wx_user_id"], name: "index_addresses_on_wx_user_id", using: :btree
  121. create_table "admin_departs", force: :cascade do |t|
  122. t.integer "admin_user_id", limit: 4, default: 0, null: false
  123. t.integer "depart_record_id", limit: 4, default: 0, null: false
  124. t.string "remark", limit: 256
  125. t.datetime "created_at"
  126. t.datetime "updated_at"
  127. end
  128. add_index "admin_departs", ["admin_user_id"], name: "index_admin_departs_on_admin_user_id", using: :btree
  129. create_table "admin_permissions", force: :cascade do |t|
  130. t.string "model", limit: 255, null: false
  131. t.string "can", limit: 255, null: false
  132. end
  133. create_table "admin_permissions_admin_roles", force: :cascade do |t|
  134. t.integer "admin_role_id", limit: 4
  135. t.integer "admin_permission_id", limit: 4
  136. end
  137. add_index "admin_permissions_admin_roles", ["admin_role_id", "admin_permission_id"], name: "idx_admin_permissions_roles_id", using: :btree
  138. add_index "admin_permissions_admin_roles", ["admin_role_id", "admin_permission_id"], name: "idx_admin_roles_id", using: :btree
  139. create_table "admin_roles", force: :cascade do |t|
  140. t.string "name", limit: 255, null: false
  141. t.text "description", limit: 65535
  142. end
  143. create_table "admin_roles_admin_users", force: :cascade do |t|
  144. t.integer "admin_role_id", limit: 4
  145. t.integer "admin_user_id", limit: 4
  146. end
  147. create_table "admin_users", force: :cascade do |t|
  148. t.string "email", limit: 255, default: "", null: false
  149. t.string "encrypted_password", limit: 255, default: "", null: false
  150. t.string "name", limit: 255, default: "", null: false
  151. t.boolean "is_super_admin", default: false, null: false
  152. t.string "reset_password_token", limit: 255
  153. t.datetime "reset_password_sent_at"
  154. t.datetime "remember_created_at"
  155. t.integer "sign_in_count", limit: 4, default: 0
  156. t.datetime "current_sign_in_at"
  157. t.datetime "last_sign_in_at"
  158. t.string "current_sign_in_ip", limit: 255
  159. t.string "last_sign_in_ip", limit: 255
  160. t.datetime "created_at"
  161. t.datetime "updated_at"
  162. end
  163. add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
  164. add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree
  165. create_table "agent_applys", force: :cascade do |t|
  166. t.integer "happen_time", limit: 4, default: 0
  167. t.integer "intro_user_id", limit: 4, default: 0
  168. t.integer "wx_user_id", limit: 4, default: 0
  169. t.string "nickname", limit: 255
  170. t.string "mobile", limit: 128
  171. t.integer "depart", limit: 4, default: 0
  172. t.integer "com_user_id", limit: 4, default: 0
  173. t.integer "com_time", limit: 4, default: 0
  174. t.boolean "status", default: false
  175. t.datetime "created_at"
  176. t.datetime "updated_at"
  177. end
  178. add_index "agent_applys", ["intro_user_id"], name: "idx_intro_user_id", using: :btree
  179. add_index "agent_applys", ["wx_user_id"], name: "idx_wx_user_id", using: :btree
  180. create_table "app_versions", force: :cascade do |t|
  181. t.datetime "created_at", precision: 3
  182. t.datetime "updated_at", precision: 3
  183. t.datetime "deleted_at", precision: 3
  184. t.string "app_type", limit: 255
  185. t.string "version", limit: 255
  186. t.string "version_code", limit: 255
  187. t.boolean "is_force"
  188. t.string "apk_url", limit: 255
  189. t.string "upgrade_point", limit: 255
  190. t.boolean "status"
  191. t.string "app_version", limit: 255
  192. end
  193. add_index "app_versions", ["deleted_at"], name: "idx_app_versions_deleted_at", using: :btree
  194. create_table "areas", force: :cascade do |t|
  195. t.integer "level", limit: 4
  196. t.integer "parent_code", limit: 8
  197. t.integer "area_code", limit: 8
  198. t.string "zip_code", limit: 6
  199. t.string "city_code", limit: 6
  200. t.string "name", limit: 50
  201. t.string "short_name", limit: 50
  202. t.string "merger_name", limit: 50
  203. t.float "lng", limit: 53
  204. t.float "lat", limit: 53
  205. t.datetime "created_at"
  206. t.datetime "updated_at"
  207. t.datetime "deleted_at"
  208. end
  209. add_index "areas", ["area_code"], name: "idx_areas_area_code", using: :btree
  210. add_index "areas", ["deleted_at"], name: "idx_areas_deleted_at", using: :btree
  211. add_index "areas", ["level"], name: "idx_areas_level", using: :btree
  212. add_index "areas", ["parent_code"], name: "idx_areas_parent_code", using: :btree
  213. create_table "article_cats", force: :cascade do |t|
  214. t.string "name", limit: 100, null: false
  215. t.integer "position", limit: 4
  216. t.string "ancestry", limit: 100
  217. t.boolean "state", default: false
  218. end
  219. add_index "article_cats", ["ancestry"], name: "index_article_cats_on_ancestry", using: :btree
  220. add_index "article_cats", ["name"], name: "index_article_cats_on_name", using: :btree
  221. add_index "article_cats", ["position"], name: "index_article_cats_on_position", using: :btree
  222. create_table "articles", force: :cascade do |t|
  223. t.string "title", limit: 100, null: false
  224. t.string "subtitle", limit: 100
  225. t.text "about", limit: 255
  226. t.text "content", limit: 4294967295, null: false
  227. t.text "url", limit: 65535
  228. t.string "cover", limit: 255
  229. t.string "source", limit: 100
  230. t.string "editor", limit: 100
  231. t.integer "click", limit: 4, default: 0
  232. t.integer "sort", limit: 4, default: 0
  233. t.integer "recommend", limit: 4
  234. t.boolean "state", default: false
  235. t.boolean "display_cover", default: false
  236. t.string "created_by", limit: 100
  237. t.integer "article_cat_id", limit: 4, null: false
  238. t.integer "agree", limit: 4, default: 0
  239. t.integer "disagree", limit: 4, default: 0
  240. t.string "tags", limit: 255
  241. t.string "seo_title", limit: 255
  242. t.string "seo_keyword", limit: 255
  243. t.string "seo_desc", limit: 255
  244. t.text "url_guide", limit: 65535
  245. t.string "share_benefit_desc", limit: 255
  246. t.boolean "show_cs_qrcode", default: false
  247. t.datetime "created_at"
  248. t.datetime "updated_at"
  249. t.string "s_title", limit: 255
  250. t.string "s_img", limit: 255
  251. end
  252. add_index "articles", ["article_cat_id"], name: "index_articles_on_article_cat_id", using: :btree
  253. add_index "articles", ["title"], name: "index_articles_on_title", using: :btree
  254. create_table "balance_orders", force: :cascade do |t|
  255. t.string "order_id", limit: 64, null: false
  256. t.integer "user_id", limit: 4, null: false
  257. t.integer "wx_user_id", limit: 4
  258. t.string "pay_way", limit: 20
  259. t.string "trade_no", limit: 64
  260. t.integer "paied_at", limit: 4
  261. t.integer "total_price", limit: 8, default: 0
  262. t.boolean "state", default: false
  263. t.string "remark", limit: 255
  264. t.string "balance_bank_card_no", limit: 255
  265. t.datetime "created_at"
  266. t.datetime "updated_at"
  267. t.integer "paied_price", limit: 8, default: 0
  268. t.integer "calc_flag", limit: 4, default: 0
  269. t.integer "depart", limit: 4
  270. t.integer "present_flag", limit: 4, default: 0
  271. t.integer "update_user", limit: 4
  272. end
  273. add_index "balance_orders", ["depart"], name: "index_balance_orders_on_depart", using: :btree
  274. add_index "balance_orders", ["order_id"], name: "index_balance_orders_on_order_id", using: :btree
  275. add_index "balance_orders", ["user_id"], name: "index_balance_orders_on_user_id", using: :btree
  276. add_index "balance_orders", ["wx_user_id"], name: "index_balance_orders_on_wx_user_id", using: :btree
  277. create_table "balance_promotions", force: :cascade do |t|
  278. t.string "name", limit: 128
  279. t.datetime "begin_time"
  280. t.datetime "end_time"
  281. t.integer "min_total", limit: 4, default: 0
  282. t.integer "send_prod1", limit: 4, default: 0
  283. t.integer "send_nums1", limit: 4, default: 0
  284. t.integer "send_prod2", limit: 4, default: 0
  285. t.integer "send_nums2", limit: 4, default: 0
  286. t.integer "send_prod3", limit: 4, default: 0
  287. t.integer "send_nums3", limit: 4, default: 0
  288. t.boolean "is_enable", default: true
  289. t.integer "cash", limit: 4, default: 0
  290. t.integer "cent", limit: 4, default: 0
  291. t.datetime "created_at"
  292. t.datetime "updated_at"
  293. t.integer "max_total", limit: 4, default: 0
  294. t.integer "depart", limit: 4, default: 0, null: false
  295. t.integer "is_more", limit: 1, default: 0
  296. end
  297. create_table "balances", force: :cascade do |t|
  298. t.integer "user_id", limit: 4
  299. t.integer "wx_user_id", limit: 4
  300. t.integer "count", limit: 4
  301. t.string "source", limit: 64
  302. t.string "relate_id", limit: 255
  303. t.string "remark", limit: 255
  304. t.datetime "created_at"
  305. t.datetime "updated_at"
  306. end
  307. add_index "balances", ["relate_id"], name: "index_balances_on_relate_id", using: :btree
  308. add_index "balances", ["user_id"], name: "index_balances_on_user_id", using: :btree
  309. add_index "balances", ["wx_user_id"], name: "index_balances_on_wx_user_id", using: :btree
  310. create_table "base_configs", force: :cascade do |t|
  311. t.integer "buy_cash", limit: 4, default: 0, null: false
  312. t.integer "send_cash", limit: 4, default: 0, null: false
  313. t.integer "cash_award", limit: 4, default: 0, null: false
  314. t.integer "order_limit", limit: 4, default: 0, null: false
  315. t.integer "freight", limit: 4, default: 0, null: false
  316. t.integer "user_apply", limit: 4, default: 0, null: false
  317. t.integer "user_cash", limit: 4, default: 0, null: false
  318. t.integer "user_award", limit: 4, default: 0, null: false
  319. t.integer "agent_apply", limit: 4, default: 0, null: false
  320. t.integer "agent_cash", limit: 4, default: 0, null: false
  321. t.integer "agent_award", limit: 4, default: 0, null: false
  322. t.string "remark", limit: 255
  323. t.datetime "created_at"
  324. t.datetime "updated_at"
  325. end
  326. create_table "base_details", force: :cascade do |t|
  327. t.string "order_no", limit: 200, default: "0"
  328. t.integer "product_id", limit: 4, default: 0
  329. t.integer "dt_id", limit: 4, default: 0
  330. t.integer "order_id", limit: 4, default: 0
  331. t.integer "is_zeng", limit: 1
  332. t.string "size_name", limit: 200
  333. t.string "color_name", limit: 200
  334. t.integer "nums", limit: 4, default: 0
  335. t.integer "price", limit: 4, default: 0
  336. t.string "product_name", limit: 200
  337. t.integer "depart", limit: 4
  338. t.datetime "created_at"
  339. t.datetime "updated_at"
  340. t.integer "link_flag", limit: 4, default: 0
  341. t.string "product_no", limit: 128
  342. t.string "order_status", limit: 64
  343. end
  344. create_table "bind_users", force: :cascade do |t|
  345. t.integer "wx_uid", limit: 4, null: false
  346. t.string "user_no", limit: 255
  347. t.string "nickname", limit: 255
  348. t.string "remark", limit: 255
  349. t.datetime "created_at"
  350. t.datetime "updated_at"
  351. end
  352. add_index "bind_users", ["wx_uid"], name: "index_bind_users_on_wx_uid", using: :btree
  353. create_table "carts", force: :cascade do |t|
  354. t.integer "user_id", limit: 8, default: 0
  355. t.integer "wx_user_id", limit: 8, default: 0
  356. t.integer "product_id", limit: 8, default: 0
  357. t.integer "nums", limit: 8, default: 0
  358. t.boolean "is_buy", default: true
  359. t.datetime "created_at"
  360. t.datetime "updated_at"
  361. end
  362. create_table "cash_balances", force: :cascade do |t|
  363. t.integer "wx_uid", limit: 4, null: false
  364. t.integer "count", limit: 4, null: false
  365. t.string "source", limit: 64
  366. t.string "relate_id", limit: 255
  367. t.string "remark", limit: 255
  368. t.datetime "created_at"
  369. t.datetime "updated_at"
  370. t.boolean "profit_flag", default: false, null: false
  371. t.string "trade_no", limit: 255, default: "", null: false
  372. end
  373. add_index "cash_balances", ["wx_uid"], name: "index_cash_balances_on_wx_uid", using: :btree
  374. create_table "cent0_balances", force: :cascade do |t|
  375. t.integer "wx_uid", limit: 4, null: false
  376. t.integer "count", limit: 4, null: false
  377. t.string "source", limit: 64
  378. t.string "relate_id", limit: 255
  379. t.string "remark", limit: 255
  380. t.datetime "created_at"
  381. t.datetime "updated_at"
  382. end
  383. add_index "cent0_balances", ["wx_uid"], name: "index_cent0_balances_on_wx_uid", using: :btree
  384. create_table "cent1_balances", force: :cascade do |t|
  385. t.integer "wx_uid", limit: 4, null: false
  386. t.integer "count", limit: 4, null: false
  387. t.string "source", limit: 64
  388. t.string "relate_id", limit: 255
  389. t.string "remark", limit: 255
  390. t.datetime "created_at"
  391. t.datetime "updated_at"
  392. end
  393. add_index "cent1_balances", ["wx_uid"], name: "index_cent1_balances_on_wx_uid", using: :btree
  394. create_table "cent2_balances", force: :cascade do |t|
  395. t.integer "wx_uid", limit: 4, null: false
  396. t.integer "count", limit: 4, null: false
  397. t.string "source", limit: 64
  398. t.string "relate_id", limit: 255
  399. t.string "remark", limit: 255
  400. t.datetime "created_at"
  401. t.datetime "updated_at"
  402. end
  403. add_index "cent2_balances", ["wx_uid"], name: "index_cent2_balances_on_wx_uid", using: :btree
  404. create_table "cent3_balances", force: :cascade do |t|
  405. t.integer "wx_uid", limit: 4, null: false
  406. t.integer "count", limit: 4, null: false
  407. t.string "source", limit: 64
  408. t.string "relate_id", limit: 255
  409. t.string "remark", limit: 255
  410. t.datetime "created_at"
  411. t.datetime "updated_at"
  412. end
  413. add_index "cent3_balances", ["wx_uid"], name: "index_cent3_balances_on_wx_uid", using: :btree
  414. create_table "cent4_balances", force: :cascade do |t|
  415. t.integer "wx_uid", limit: 4, null: false
  416. t.integer "count", limit: 4, null: false
  417. t.string "source", limit: 64
  418. t.string "relate_id", limit: 255
  419. t.string "remark", limit: 255
  420. t.datetime "created_at"
  421. t.datetime "updated_at"
  422. end
  423. add_index "cent4_balances", ["wx_uid"], name: "index_cent4_balances_on_wx_uid", using: :btree
  424. create_table "cent5_balances", force: :cascade do |t|
  425. t.integer "wx_uid", limit: 4, null: false
  426. t.integer "count", limit: 4, null: false
  427. t.string "source", limit: 64
  428. t.string "relate_id", limit: 255
  429. t.string "remark", limit: 255
  430. t.datetime "created_at"
  431. t.datetime "updated_at"
  432. end
  433. add_index "cent5_balances", ["wx_uid"], name: "index_cent5_balances_on_wx_uid", using: :btree
  434. create_table "cent6_balances", force: :cascade do |t|
  435. t.integer "wx_uid", limit: 4, null: false
  436. t.integer "count", limit: 4, null: false
  437. t.string "source", limit: 64
  438. t.string "relate_id", limit: 255
  439. t.string "remark", limit: 255
  440. t.datetime "created_at"
  441. t.datetime "updated_at"
  442. end
  443. add_index "cent6_balances", ["wx_uid"], name: "index_cent6_balances_on_wx_uid", using: :btree
  444. create_table "cent7_balances", force: :cascade do |t|
  445. t.integer "wx_uid", limit: 4, null: false
  446. t.integer "count", limit: 4, null: false
  447. t.string "source", limit: 64
  448. t.string "relate_id", limit: 255
  449. t.string "remark", limit: 255
  450. t.datetime "created_at"
  451. t.datetime "updated_at"
  452. end
  453. add_index "cent7_balances", ["wx_uid"], name: "index_cent7_balances_on_wx_uid", using: :btree
  454. create_table "cent8_balances", force: :cascade do |t|
  455. t.integer "wx_uid", limit: 4, null: false
  456. t.integer "count", limit: 4, null: false
  457. t.string "source", limit: 64
  458. t.string "relate_id", limit: 255
  459. t.string "remark", limit: 255
  460. t.datetime "created_at"
  461. t.datetime "updated_at"
  462. end
  463. add_index "cent8_balances", ["wx_uid"], name: "index_cent8_balances_on_wx_uid", using: :btree
  464. create_table "cent9_balances", force: :cascade do |t|
  465. t.integer "wx_uid", limit: 4, null: false
  466. t.integer "count", limit: 4, null: false
  467. t.string "source", limit: 64
  468. t.string "relate_id", limit: 255
  469. t.string "remark", limit: 255
  470. t.datetime "created_at"
  471. t.datetime "updated_at"
  472. end
  473. add_index "cent9_balances", ["wx_uid"], name: "index_cent9_balances_on_wx_uid", using: :btree
  474. create_table "cent_awards", force: :cascade do |t|
  475. t.integer "count", limit: 4, null: false
  476. t.string "c_type", limit: 64
  477. t.string "remark", limit: 255
  478. t.datetime "created_at"
  479. t.datetime "updated_at"
  480. end
  481. add_index "cent_awards", ["c_type"], name: "index_cent_awards_on_c_type", using: :btree
  482. create_table "cent_balances", force: :cascade do |t|
  483. t.integer "wx_uid", limit: 4, null: false
  484. t.integer "count", limit: 4, null: false
  485. t.string "source", limit: 64
  486. t.string "relate_id", limit: 255
  487. t.string "remark", limit: 255
  488. t.datetime "created_at"
  489. t.datetime "updated_at"
  490. end
  491. add_index "cent_balances", ["wx_uid"], name: "index_cent_balances_on_wx_uid", using: :btree
  492. create_table "channel_qrcode_results", force: :cascade do |t|
  493. t.string "mp_openid", limit: 255, default: "0"
  494. t.integer "channel_qrcode_id", limit: 4
  495. t.datetime "created_at", null: false
  496. t.datetime "updated_at", null: false
  497. end
  498. add_index "channel_qrcode_results", ["channel_qrcode_id"], name: "index_channel_qrcode_results_on_channel_qrcode_id", using: :btree
  499. 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
  500. add_index "channel_qrcode_results", ["mp_openid"], name: "index_channel_qrcode_results_on_openid", using: :btree
  501. create_table "channel_qrcodes", force: :cascade do |t|
  502. t.integer "wx_gongzhonghao_id", limit: 4, null: false
  503. t.integer "parent_sign_up_channel_id", limit: 4
  504. t.integer "scene_id", limit: 4, default: 0
  505. t.string "scene_str", limit: 64
  506. t.boolean "is_permanent", default: false
  507. t.text "remark", limit: 65535, null: false
  508. t.text "qrcode_img", limit: 65535
  509. t.datetime "expired_at"
  510. t.integer "scan_times", limit: 4, default: 0
  511. t.datetime "created_at", null: false
  512. t.datetime "updated_at", null: false
  513. t.integer "push_after_sub_id", limit: 4, default: 0
  514. t.integer "ad_cost", limit: 4, default: 0
  515. end
  516. add_index "channel_qrcodes", ["expired_at"], name: "index_channel_qrcodes_on_expired_at", using: :btree
  517. create_table "ckeditor_assets", force: :cascade do |t|
  518. t.string "data_file_name", limit: 255, null: false
  519. t.string "data_content_type", limit: 255
  520. t.integer "data_file_size", limit: 4
  521. t.integer "assetable_id", limit: 4
  522. t.string "assetable_type", limit: 30
  523. t.string "type", limit: 30
  524. t.integer "width", limit: 4
  525. t.integer "height", limit: 4
  526. t.datetime "created_at"
  527. t.datetime "updated_at"
  528. end
  529. add_index "ckeditor_assets", ["assetable_type", "assetable_id"], name: "idx_ckeditor_assetable", using: :btree
  530. add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], name: "idx_ckeditor_assetable_type", using: :btree
  531. create_table "commend_words", force: :cascade do |t|
  532. t.integer "sort", limit: 4
  533. t.string "title", limit: 255
  534. t.boolean "state", default: false
  535. t.datetime "created_at"
  536. t.datetime "updated_at"
  537. end
  538. create_table "common_use_limits", force: :cascade do |t|
  539. t.integer "wx_uid", limit: 4, null: false
  540. t.boolean "is_limit_up_benefit_list", default: false
  541. t.boolean "is_effect", default: false
  542. t.datetime "created_at"
  543. t.datetime "updated_at"
  544. end
  545. add_index "common_use_limits", ["wx_uid"], name: "index_common_use_limits_on_wx_uid", using: :btree
  546. create_table "delete_user", force: :cascade do |t|
  547. t.text "result", limit: 65535
  548. t.integer "user_id", limit: 8
  549. t.text "wx_user", limit: 65535
  550. t.datetime "created_at", precision: 3
  551. t.datetime "updated_at", precision: 3
  552. end
  553. create_table "depart_records", force: :cascade do |t|
  554. t.integer "wx_user_id", limit: 4, default: 0, null: false
  555. t.string "name", limit: 255
  556. t.text "inner_no", limit: 65535
  557. t.string "remark", limit: 255
  558. t.datetime "created_at"
  559. t.datetime "updated_at"
  560. t.string "pick_title", limit: 128
  561. t.string "pick_address", limit: 128
  562. t.boolean "pick", default: false
  563. end
  564. add_index "depart_records", ["wx_user_id"], name: "index_depart_records_on_wx_user_id", using: :btree
  565. create_table "depart_records_balance_promotions", force: :cascade do |t|
  566. t.integer "balance_promotion_id", limit: 4
  567. t.integer "depart_record_id", limit: 4
  568. end
  569. add_index "depart_records_balance_promotions", ["balance_promotion_id", "depart_record_id"], name: "idx_balance_pomotion_d_r_id", using: :btree
  570. create_table "depart_records_group_messages", force: :cascade do |t|
  571. t.integer "group_message_id", limit: 4
  572. t.integer "depart_record_id", limit: 4
  573. end
  574. add_index "depart_records_group_messages", ["group_message_id", "depart_record_id"], name: "idx_group_message_id", using: :btree
  575. create_table "depart_records_live_broads", force: :cascade do |t|
  576. t.integer "live_broad_id", limit: 4
  577. t.integer "depart_record_id", limit: 4
  578. end
  579. add_index "depart_records_live_broads", ["live_broad_id", "depart_record_id"], name: "idx_live_broad_id", using: :btree
  580. create_table "depart_records_products", force: :cascade do |t|
  581. t.integer "product_id", limit: 4
  582. t.integer "depart_record_id", limit: 4
  583. end
  584. add_index "depart_records_products", ["product_id", "depart_record_id"], name: "idx_product_id", using: :btree
  585. create_table "depart_records_promotions", force: :cascade do |t|
  586. t.integer "promotion_id", limit: 4
  587. t.integer "depart_record_id", limit: 4
  588. end
  589. add_index "depart_records_promotions", ["promotion_id", "depart_record_id"], name: "idx_pomotion_d_r_id", using: :btree
  590. create_table "depart_records_shop_promotions", force: :cascade do |t|
  591. t.integer "shop_promotion_id", limit: 4
  592. t.integer "depart_record_id", limit: 4
  593. end
  594. add_index "depart_records_shop_promotions", ["shop_promotion_id", "depart_record_id"], name: "idx_shop_pomotion_d_r_id", using: :btree
  595. create_table "economic_statics", force: :cascade do |t|
  596. t.datetime "begin_time"
  597. t.integer "balance", limit: 4, default: 0, null: false
  598. t.integer "cash_balance", limit: 4, default: 0, null: false
  599. t.integer "cent", limit: 4, default: 0, null: false
  600. t.string "remark", limit: 255
  601. t.datetime "created_at"
  602. t.datetime "updated_at"
  603. end
  604. create_table "employ_static_foods", force: :cascade do |t|
  605. t.datetime "created_at", precision: 3
  606. t.datetime "updated_at", precision: 3
  607. t.string "food_date", limit: 191
  608. t.integer "employ_id", limit: 8
  609. t.integer "source", limit: 2
  610. t.integer "nums", limit: 8
  611. t.integer "cancel_nums", limit: 8
  612. t.boolean "single"
  613. t.integer "total", limit: 8
  614. t.string "employ_name", limit: 191
  615. t.integer "food_buy_id", limit: 8
  616. t.integer "status", limit: 8
  617. end
  618. create_table "employs", force: :cascade do |t|
  619. t.string "mobile", limit: 100
  620. t.string "user_name", limit: 100
  621. t.datetime "created_at", precision: 3
  622. t.datetime "updated_at", precision: 3
  623. t.integer "wx_user_id", limit: 8
  624. end
  625. create_table "express_companys", force: :cascade do |t|
  626. t.string "express_code", limit: 128, default: "", null: false
  627. t.string "express_company", limit: 128, default: "", null: false
  628. t.datetime "create_time", null: false
  629. t.datetime "update_time", null: false
  630. end
  631. create_table "file_users", force: :cascade do |t|
  632. t.datetime "created_at", precision: 3
  633. t.datetime "updated_at", precision: 3
  634. t.datetime "deleted_at", precision: 3
  635. t.integer "user_id", limit: 8
  636. t.integer "company_id", limit: 8
  637. t.string "type", limit: 191
  638. t.string "name", limit: 255
  639. t.boolean "folder"
  640. t.integer "folder_id", limit: 8
  641. t.string "pinyin", limit: 191
  642. t.string "fist_pinyin", limit: 191
  643. t.integer "file_id", limit: 8
  644. end
  645. add_index "file_users", ["company_id"], name: "idx_file_users_company_id", using: :btree
  646. add_index "file_users", ["deleted_at"], name: "idx_file_users_deleted_at", using: :btree
  647. add_index "file_users", ["file_id"], name: "idx_file_users_file_id", using: :btree
  648. add_index "file_users", ["fist_pinyin"], name: "idx_file_users_fist_pinyin", using: :btree
  649. add_index "file_users", ["folder"], name: "idx_file_users_folder", using: :btree
  650. add_index "file_users", ["folder_id"], name: "idx_file_users_folder_id", using: :btree
  651. add_index "file_users", ["pinyin"], name: "idx_file_users_pinyin", using: :btree
  652. add_index "file_users", ["type"], name: "idx_file_users_type", using: :btree
  653. add_index "file_users", ["user_id"], name: "idx_file_users_user_id", using: :btree
  654. create_table "files", force: :cascade do |t|
  655. t.datetime "created_at", precision: 3
  656. t.string "path", limit: 255
  657. t.string "hash", limit: 191
  658. t.string "mime", limit: 191
  659. t.string "ext", limit: 191
  660. t.string "type", limit: 191
  661. t.integer "size", limit: 8
  662. end
  663. add_index "files", ["ext"], name: "idx_files_ext", using: :btree
  664. add_index "files", ["hash"], name: "idx_files_hash", using: :btree
  665. add_index "files", ["mime"], name: "idx_files_mime", using: :btree
  666. add_index "files", ["type"], name: "idx_files_type", using: :btree
  667. create_table "food_forbid_date", force: :cascade do |t|
  668. t.date "forbid_date"
  669. t.integer "source", limit: 4
  670. t.datetime "created_at", precision: 3
  671. t.datetime "updated_at", precision: 3
  672. end
  673. create_table "food_unsubs", force: :cascade do |t|
  674. t.datetime "created_at", precision: 3
  675. t.datetime "updated_at", precision: 3
  676. t.string "food_date", limit: 191
  677. t.integer "source", limit: 8
  678. t.integer "employ_id", limit: 8
  679. t.string "employ_name", limit: 191
  680. t.integer "nums", limit: 8
  681. t.integer "total", limit: 8
  682. t.string "remark", limit: 191
  683. t.boolean "status", default: false
  684. end
  685. create_table "group_message_records", force: :cascade do |t|
  686. t.integer "wx_user_id", limit: 4, default: 0
  687. t.string "mobile", limit: 64
  688. t.string "group_message_id", limit: 128, default: "0"
  689. t.datetime "created_at"
  690. t.datetime "updated_at"
  691. t.integer "flag", limit: 4, default: 0, null: false
  692. end
  693. add_index "group_message_records", ["mobile"], name: "idx_mobile", using: :btree
  694. create_table "group_messages", force: :cascade do |t|
  695. t.integer "depart_record_id", limit: 4, default: 0
  696. t.string "code", limit: 64
  697. t.string "name", limit: 128, default: "0"
  698. t.string "keyword1", limit: 128
  699. t.string "keyword2", limit: 128
  700. t.string "keyword3", limit: 128
  701. t.integer "count", limit: 4
  702. t.string "remark", limit: 128
  703. t.datetime "created_at"
  704. t.datetime "updated_at"
  705. end
  706. add_index "group_messages", ["code"], name: "idx_code", using: :btree
  707. create_table "invite_benefit_orders", force: :cascade do |t|
  708. t.integer "benefit_wx_uid", limit: 4, null: false
  709. t.integer "wx_uid", limit: 4, null: false
  710. t.integer "ind_wx_uid", limit: 4, null: false
  711. t.integer "count", limit: 4, null: false
  712. t.integer "amount", limit: 4, null: false
  713. t.string "source", limit: 64
  714. t.string "relate_id", limit: 255
  715. t.datetime "created_at"
  716. t.datetime "updated_at"
  717. t.boolean "is_enter_balance", default: false, null: false
  718. t.datetime "enter_time"
  719. end
  720. add_index "invite_benefit_orders", ["benefit_wx_uid"], name: "index_invite_benefit_orders_on_benefit_wx_uid", using: :btree
  721. create_table "jwts", force: :cascade do |t|
  722. t.datetime "created_at", precision: 3
  723. t.datetime "expires_at", precision: 3
  724. t.integer "user_id", limit: 8
  725. t.string "uuid", limit: 255
  726. t.integer "company", limit: 8
  727. end
  728. add_index "jwts", ["company"], name: "idx_jwts_company", using: :btree
  729. add_index "jwts", ["user_id"], name: "idx_jwts_user_id", using: :btree
  730. create_table "key_word_pushs", force: :cascade do |t|
  731. t.string "key_word", limit: 255
  732. t.string "push_type", limit: 255, null: false
  733. t.string "push_title", limit: 255
  734. t.string "cover", limit: 255
  735. t.string "word", limit: 255
  736. t.string "url", limit: 255
  737. t.string "remark", limit: 255, null: false
  738. t.integer "wx_gongzhonghao_id", limit: 4
  739. t.datetime "created_at"
  740. t.datetime "updated_at"
  741. end
  742. add_index "key_word_pushs", ["key_word"], name: "index_key_word_pushs_on_key_word", using: :btree
  743. create_table "list_files", force: :cascade do |t|
  744. t.string "order_no", limit: 255
  745. t.string "order_status", limit: 128
  746. t.datetime "paied_date"
  747. t.datetime "paied_date_end"
  748. t.integer "paied_time", limit: 4, default: 0
  749. t.integer "depart", limit: 4, default: 0
  750. t.string "list_file", limit: 255
  751. t.boolean "status", default: false
  752. t.datetime "created_at"
  753. t.datetime "updated_at"
  754. t.string "line_file", limit: 128, default: "", null: false
  755. t.string "pdf_file", limit: 128, default: "", null: false
  756. end
  757. create_table "live_awards", force: :cascade do |t|
  758. t.string "openid", limit: 256
  759. t.integer "wx_user_id", limit: 4, default: 0
  760. t.string "remark", limit: 256
  761. t.integer "room_id", limit: 4, default: 0
  762. t.integer "prod1", limit: 4, default: 0
  763. t.integer "nums1", limit: 4, default: 0
  764. t.integer "prod2", limit: 4, default: 0
  765. t.integer "nums2", limit: 4, default: 0
  766. t.integer "prod3", limit: 4, default: 0
  767. t.integer "nums3", limit: 4, default: 0
  768. t.integer "cash", limit: 4, default: 0
  769. t.integer "cent", limit: 4, default: 0
  770. t.string "address", limit: 256
  771. t.string "contact", limit: 256
  772. t.string "tel", limit: 256
  773. t.boolean "status", default: false
  774. t.datetime "created_at"
  775. t.datetime "updated_at"
  776. end
  777. add_index "live_awards", ["wx_user_id"], name: "index_live_awards_on_wx_user_id", using: :btree
  778. create_table "live_broads", force: :cascade do |t|
  779. t.string "title", limit: 128, null: false
  780. t.string "cover", limit: 256
  781. t.integer "room_id", limit: 4, default: 0, null: false
  782. t.datetime "begin_time"
  783. t.datetime "end_time"
  784. t.boolean "show", default: false
  785. t.string "remark", limit: 256
  786. t.integer "recommend", limit: 4, default: 0, null: false
  787. t.datetime "created_at"
  788. t.datetime "updated_at"
  789. t.string "rank_strs", limit: 255, default: ""
  790. end
  791. add_index "live_broads", ["room_id"], name: "index_live_broads_on_room_id", using: :btree
  792. create_table "main_economics", force: :cascade do |t|
  793. t.integer "wx_uid", limit: 4, null: false
  794. t.integer "cent", limit: 4, null: false
  795. t.boolean "is_wrong", default: false
  796. t.string "remark", limit: 255
  797. t.datetime "created_at"
  798. t.datetime "updated_at"
  799. end
  800. add_index "main_economics", ["wx_uid"], name: "index_main_economics_on_wx_uid", using: :btree
  801. create_table "merchant_user_relations", force: :cascade do |t|
  802. t.integer "merchant_id", limit: 4, null: false
  803. t.integer "user_id", limit: 4, null: false
  804. t.boolean "is_effect", default: false
  805. t.datetime "created_at"
  806. t.datetime "updated_at"
  807. t.boolean "is_super_admin", default: false
  808. t.text "manage_product_ids", limit: 65535
  809. end
  810. add_index "merchant_user_relations", ["merchant_id"], name: "index_merchant_user_relations_on_merchant_id", using: :btree
  811. add_index "merchant_user_relations", ["user_id"], name: "index_merchant_user_relations_on_user_id", using: :btree
  812. create_table "merchants", force: :cascade do |t|
  813. t.integer "user_id", limit: 4
  814. t.string "name", limit: 100
  815. t.string "contact", limit: 16
  816. t.datetime "created_at"
  817. t.datetime "updated_at"
  818. t.string "tel", limit: 20
  819. t.string "payee", limit: 64, null: false
  820. t.string "bank_card_no", limit: 64, null: false
  821. t.string "bank_name", limit: 64, null: false
  822. t.string "back_voucher", limit: 100, null: false
  823. end
  824. add_index "merchants", ["user_id"], name: "index_wx_users_on_user_id", using: :btree
  825. create_table "navigate_icon_configs", force: :cascade do |t|
  826. t.string "name", limit: 10, default: "", null: false
  827. t.integer "sort", limit: 4, default: 1, null: false
  828. t.string "url", limit: 4096, default: "", null: false
  829. t.integer "url_type", limit: 1, default: 0
  830. t.string "cover", limit: 255
  831. t.boolean "state", default: true, null: false
  832. t.string "remark", limit: 225, default: ""
  833. t.integer "product_cat_index", limit: 4, default: 0, null: false
  834. t.boolean "app_state", default: false, null: false
  835. end
  836. create_table "order_details", force: :cascade do |t|
  837. t.string "order_no", limit: 200, default: "0"
  838. t.integer "product_id", limit: 4, default: 0
  839. t.integer "nums", limit: 4, default: 0
  840. t.integer "unit_robo_balance_price", limit: 4
  841. t.integer "price", limit: 4, default: 0
  842. t.string "product_name", limit: 200
  843. t.datetime "created_at"
  844. t.datetime "updated_at"
  845. t.integer "order_id", limit: 4, default: 0
  846. t.boolean "is_zeng", default: false
  847. t.boolean "is_delete"
  848. t.string "size_name", limit: 128
  849. t.string "color_name", limit: 128
  850. t.integer "depart", limit: 4
  851. t.boolean "commend", default: false
  852. t.integer "relate_product_id", limit: 4, default: 0, null: false
  853. t.string "product_no", limit: 128
  854. t.integer "link_flag", limit: 4, default: 0
  855. t.integer "pv", limit: 4, default: 0
  856. t.string "order_status", limit: 64
  857. t.integer "silver", limit: 4, default: 0
  858. t.integer "dis_amount", limit: 4, default: 0
  859. end
  860. add_index "order_details", ["order_id"], name: "index_orderId", using: :btree
  861. add_index "order_details", ["order_no"], name: "index_orderNo", using: :btree
  862. add_index "order_details", ["product_id"], name: "index_productId", using: :btree
  863. create_table "order_refunds", force: :cascade do |t|
  864. t.string "order_id", limit: 128
  865. t.integer "wx_user_id", limit: 4, default: 0
  866. t.string "transaction_id", limit: 256
  867. t.integer "total", limit: 4, default: 0
  868. t.integer "refund_fee", limit: 4, default: 0
  869. t.integer "refund_time", limit: 4, default: 0
  870. t.boolean "status", default: false
  871. t.string "remark", limit: 128
  872. t.datetime "created_at"
  873. t.datetime "updated_at"
  874. end
  875. add_index "order_refunds", ["order_id"], name: "index_order_refunds_on_order_id", using: :btree
  876. create_table "order_static_details", force: :cascade do |t|
  877. t.date "begin_date"
  878. t.date "end_date"
  879. t.string "state", limit: 256
  880. t.boolean "is_send", default: true
  881. t.integer "product_id", limit: 8, default: 0
  882. t.integer "static_id", limit: 8, default: 0
  883. t.string "product_name", limit: 256
  884. t.integer "nums", limit: 8, default: 0
  885. t.integer "total", limit: 4, default: 0
  886. t.datetime "created_at"
  887. t.datetime "updated_at"
  888. end
  889. create_table "order_statics", force: :cascade do |t|
  890. t.date "begin_date"
  891. t.date "end_date"
  892. t.string "state", limit: 256
  893. t.boolean "is_send", default: true
  894. t.datetime "created_at"
  895. t.datetime "updated_at"
  896. end
  897. create_table "orders", force: :cascade do |t|
  898. t.string "order_id", limit: 255, null: false
  899. t.integer "order_type", limit: 1, default: 0
  900. t.integer "wx_user_id", limit: 4, default: 0, null: false
  901. t.integer "user_id", limit: 4, null: false
  902. t.integer "total_price", limit: 4, null: false
  903. t.integer "paied_price", limit: 4, default: 0
  904. t.integer "buy_price", limit: 4, default: 0
  905. t.integer "count", limit: 4, default: 0, null: false
  906. t.integer "paied_at", limit: 4, default: 0
  907. t.string "trade_no", limit: 255
  908. t.string "status", limit: 255
  909. t.string "pay_way", limit: 255
  910. t.string "tel", limit: 255
  911. t.string "address", limit: 255
  912. t.string "contact", limit: 255
  913. t.string "express_company", limit: 255
  914. t.string "express_order_no", limit: 255
  915. t.string "remark", limit: 255
  916. t.datetime "dispatch_time"
  917. t.datetime "created_at"
  918. t.datetime "updated_at"
  919. t.datetime "receive_time"
  920. t.string "order_remark", limit: 255
  921. t.string "source", limit: 255, default: "xcx"
  922. t.integer "freight", limit: 4, default: 0
  923. t.integer "calc_flag", limit: 4, default: 0, null: false
  924. t.datetime "paied_time"
  925. t.string "express_code", limit: 128, default: "", null: false
  926. t.integer "coupon_price", limit: 4, default: 0, null: false
  927. t.integer "cent_price", limit: 4, default: 0, null: false
  928. t.integer "depart", limit: 4
  929. t.integer "link_flag", limit: 4, default: 0
  930. t.integer "pv", limit: 4, default: 0
  931. t.integer "pick_way", limit: 4, default: 0
  932. t.integer "pick_dept", limit: 4, default: 0
  933. t.boolean "has_commission", default: false
  934. t.string "promotions", limit: 255
  935. t.string "normal_promotions", limit: 255
  936. t.string "not_promotion_amount", limit: 255
  937. t.integer "address_id", limit: 4, default: 0
  938. t.integer "dis_amount", limit: 4, default: 0
  939. t.integer "total_silver", limit: 4, default: 0
  940. t.integer "paied_silver", limit: 4, default: 0
  941. t.integer "paied_cash", limit: 4, default: 0
  942. end
  943. add_index "orders", ["address"], name: "index_orders_on_address", using: :btree
  944. add_index "orders", ["depart"], name: "index_orders_on_depart", using: :btree
  945. add_index "orders", ["order_id"], name: "index_orders_on_order_id", using: :btree
  946. add_index "orders", ["paied_time"], name: "index_orders_on_paied_at", using: :btree
  947. add_index "orders", ["user_id"], name: "index_orders_on_user_id", using: :btree
  948. add_index "orders", ["wx_user_id"], name: "index_orders_on_wx_user_id", using: :btree
  949. create_table "parent_signup_channels", force: :cascade do |t|
  950. t.string "name", limit: 255
  951. t.string "desc", limit: 255
  952. t.datetime "created_at"
  953. t.datetime "updated_at"
  954. end
  955. create_table "pay_configs", force: :cascade do |t|
  956. t.integer "depart", limit: 4, default: 0, null: false
  957. t.string "pay_code", limit: 255
  958. t.string "remark", limit: 255
  959. t.datetime "created_at"
  960. t.datetime "updated_at"
  961. end
  962. add_index "pay_configs", ["depart"], name: "index_pay_configs_on_depart", using: :btree
  963. create_table "pick_addresses", force: :cascade do |t|
  964. t.integer "wx_user_id", limit: 4
  965. t.string "contact", limit: 255
  966. t.string "tel", limit: 255
  967. t.string "remark", limit: 255
  968. t.boolean "state", default: false
  969. t.datetime "created_at"
  970. t.datetime "updated_at"
  971. end
  972. add_index "pick_addresses", ["wx_user_id"], name: "index_pick_addresses_on_wx_user_id", using: :btree
  973. create_table "platform_categories", force: :cascade do |t|
  974. t.string "name", limit: 20, default: "", null: false
  975. t.integer "position", limit: 4, default: 1, null: false
  976. t.string "ancestry", limit: 20, default: ""
  977. t.string "platform", limit: 20, default: "", null: false
  978. t.string "url", limit: 4096, default: "", null: false
  979. t.boolean "state", default: true, null: false
  980. t.string "remark", limit: 225, default: "", null: false
  981. t.integer "product_id", limit: 4, default: 0, null: false
  982. t.string "cover", limit: 255
  983. t.integer "url_type", limit: 1, default: 0
  984. end
  985. add_index "platform_categories", ["ancestry"], name: "index_platform_categories_on_ancestry", using: :btree
  986. add_index "platform_categories", ["platform"], name: "index_platform_categories_on_platform", using: :btree
  987. add_index "platform_categories", ["position"], name: "index_platform_categories_on_position", using: :btree
  988. create_table "poster_qrcode_records", force: :cascade do |t|
  989. t.integer "wx_uid", limit: 4, null: false
  990. t.integer "parent_relate_id", limit: 4, null: false
  991. t.integer "relate_id", limit: 4, null: false
  992. t.string "ptype", limit: 255
  993. t.string "qrcode_url", limit: 255
  994. t.datetime "created_at"
  995. t.datetime "updated_at"
  996. t.integer "scan_times", limit: 4, null: false
  997. end
  998. add_index "poster_qrcode_records", ["wx_uid"], name: "index_poster_qrcode_records_on_wx_uid", using: :btree
  999. create_table "poster_qrcode_scan_records", force: :cascade do |t|
  1000. t.integer "poster_qrcode_id", limit: 4, null: false
  1001. t.integer "wx_uid", limit: 4, null: false
  1002. t.string "ip", limit: 32
  1003. t.integer "scan_times", limit: 4, null: false
  1004. t.datetime "scan_last_time"
  1005. t.datetime "created_at"
  1006. t.datetime "updated_at"
  1007. end
  1008. add_index "poster_qrcode_scan_records", ["poster_qrcode_id"], name: "index_poster_qrcode_scan_records_on_poster_qrcode_id", using: :btree
  1009. 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
  1010. add_index "poster_qrcode_scan_records", ["wx_uid"], name: "index_poster_qrcode_scan_records_on_wx_uid", using: :btree
  1011. create_table "presents", force: :cascade do |t|
  1012. t.integer "wx_user_id", limit: 4, default: 0
  1013. t.integer "price", limit: 4, default: 0
  1014. t.integer "total", limit: 4, default: 0
  1015. t.integer "send_prod1", limit: 4, default: 0
  1016. t.integer "send_nums1", limit: 4, default: 0
  1017. t.boolean "status", default: false
  1018. t.string "order_id", limit: 64
  1019. t.string "source", limit: 255
  1020. t.string "remark", limit: 255
  1021. t.datetime "created_at"
  1022. t.datetime "updated_at"
  1023. end
  1024. add_index "presents", ["order_id"], name: "index_presents_on_order_id", using: :btree
  1025. add_index "presents", ["wx_user_id"], name: "index_presents_on_wx_user_id", using: :btree
  1026. create_table "product_attr_configs", force: :cascade do |t|
  1027. t.integer "product_id", limit: 8, default: 0
  1028. t.integer "attr_key_id", limit: 8, default: 0
  1029. t.string "size_type", limit: 64
  1030. t.datetime "created_at"
  1031. t.datetime "updated_at"
  1032. end
  1033. add_index "product_attr_configs", ["attr_key_id"], name: "index_product_attr_configs_on_attr_key_id", using: :btree
  1034. add_index "product_attr_configs", ["product_id"], name: "index_product_attr_configs_on_product_id", using: :btree
  1035. create_table "product_attr_keys", force: :cascade do |t|
  1036. t.string "name", limit: 128
  1037. t.boolean "status", default: true
  1038. t.datetime "created_at"
  1039. t.datetime "updated_at"
  1040. end
  1041. create_table "product_attrs", force: :cascade do |t|
  1042. t.integer "attr_key_id", limit: 8, default: 0
  1043. t.string "name", limit: 500
  1044. t.integer "recommend", limit: 8, default: 0
  1045. t.boolean "status", default: true
  1046. t.datetime "created_at"
  1047. t.datetime "updated_at"
  1048. end
  1049. add_index "product_attrs", ["attr_key_id"], name: "index_product_attrs_on_attr_key_id", using: :btree
  1050. create_table "product_cats", force: :cascade do |t|
  1051. t.string "name", limit: 20, null: false
  1052. t.integer "position", limit: 4
  1053. t.string "ancestry", limit: 20
  1054. t.boolean "status", default: true
  1055. t.boolean "cow_state", default: false
  1056. end
  1057. add_index "product_cats", ["ancestry"], name: "index_product_cats_on_ancestry", using: :btree
  1058. add_index "product_cats", ["name"], name: "index_product_cats_on_name", using: :btree
  1059. add_index "product_cats", ["position"], name: "index_product_cats_on_position", using: :btree
  1060. create_table "product_commends", force: :cascade do |t|
  1061. t.integer "wx_user_id", limit: 4, default: 0, null: false
  1062. t.integer "product_id", limit: 4, default: 0, null: false
  1063. t.string "order_id", limit: 256
  1064. t.string "detail", limit: 256
  1065. t.integer "score", limit: 4, default: 0, null: false
  1066. t.boolean "is_enable", default: false
  1067. t.boolean "is_top", default: false
  1068. t.integer "recommend", limit: 4, default: 0, null: false
  1069. t.string "remark", limit: 256
  1070. t.datetime "created_at"
  1071. t.datetime "updated_at"
  1072. end
  1073. add_index "product_commends", ["product_id"], name: "index_product_commends_on_product_id", using: :btree
  1074. add_index "product_commends", ["wx_user_id"], name: "index_product_commends_on_wx_user_id", using: :btree
  1075. create_table "product_items", force: :cascade do |t|
  1076. t.integer "product_id", limit: 4, default: 0
  1077. t.string "title", limit: 255
  1078. t.integer "item_id", limit: 4, default: 0
  1079. t.string "item_title", limit: 255
  1080. t.integer "nums", limit: 4, default: 0
  1081. t.datetime "created_at"
  1082. t.datetime "updated_at"
  1083. end
  1084. create_table "product_pictures", force: :cascade do |t|
  1085. t.string "product_id", limit: 20, null: false
  1086. t.string "img", limit: 255, null: false
  1087. t.integer "pic_type", limit: 1, default: 0
  1088. t.integer "sort", limit: 4, default: 0
  1089. t.datetime "created_at"
  1090. t.datetime "updated_at"
  1091. end
  1092. add_index "product_pictures", ["product_id"], name: "index_pictures_on_product_id", using: :btree
  1093. create_table "product_sale_subjects", force: :cascade do |t|
  1094. t.string "product_ids", limit: 255, null: false
  1095. t.string "background_img", limit: 255
  1096. t.string "subject_title", limit: 255, null: false
  1097. t.text "subject_desc", limit: 65535, null: false
  1098. t.string "qrcode_tips", limit: 255
  1099. t.string "qrcode_img", limit: 255
  1100. t.string "share_title", limit: 50
  1101. t.string "share_content", limit: 50
  1102. t.string "share_img", limit: 255
  1103. t.datetime "created_at"
  1104. t.datetime "updated_at"
  1105. t.boolean "is_prize_act", default: false, null: false
  1106. t.datetime "open_prize_time"
  1107. t.string "prize_number", limit: 20
  1108. t.string "rule", limit: 255
  1109. t.string "prize_name", limit: 50
  1110. t.integer "click", limit: 4, default: 0
  1111. end
  1112. create_table "product_sale_types", force: :cascade do |t|
  1113. t.string "name", limit: 128
  1114. t.datetime "created_at"
  1115. t.datetime "updated_at"
  1116. end
  1117. create_table "product_warns", force: :cascade do |t|
  1118. t.date "happen_time"
  1119. t.integer "product_id", limit: 4, default: 0, null: false
  1120. t.string "product_name", limit: 128, default: "", null: false
  1121. t.string "product_type", limit: 128, default: "", null: false
  1122. t.string "product_size", limit: 128, default: "", null: false
  1123. t.integer "sale_90", limit: 4, default: 0, null: false
  1124. t.integer "sale_30", limit: 4, default: 0, null: false
  1125. t.integer "sale_10", limit: 4, default: 0, null: false
  1126. t.integer "now_count", limit: 4, default: 0, null: false
  1127. t.integer "product_cycle", limit: 4, default: 0, null: false
  1128. t.integer "stock_cycle", limit: 4, default: 0, null: false
  1129. t.integer "min_purchase", limit: 4, default: 0, null: false
  1130. t.integer "history_day_sales", limit: 4, default: 0, null: false
  1131. t.integer "recommend_count", limit: 4, default: 0, null: false
  1132. t.datetime "created_at"
  1133. t.datetime "updated_at"
  1134. end
  1135. create_table "products", force: :cascade do |t|
  1136. t.string "name", limit: 100, null: false
  1137. t.integer "category_id", limit: 4
  1138. t.text "detail", limit: 65535, null: false
  1139. t.integer "price", limit: 4, null: false
  1140. t.integer "robo_balance_price", limit: 4, null: false
  1141. t.integer "mall_balance_price", limit: 4
  1142. t.string "ptype", limit: 32, default: "direct_sale", null: false
  1143. t.integer "buy_price", limit: 4, null: false
  1144. t.integer "count", limit: 4, default: 1, null: false
  1145. t.integer "recommend", limit: 4, default: 0
  1146. t.boolean "status", default: false
  1147. t.datetime "created_at"
  1148. t.datetime "updated_at"
  1149. t.integer "merchant_id", limit: 4
  1150. t.boolean "is_support_poor", default: false
  1151. t.integer "virtual_sold_count", limit: 4, default: 0
  1152. t.integer "purchase_limit_count", limit: 4, default: 0, null: false
  1153. t.integer "single_purch_limit", limit: 4, default: 0, null: false
  1154. t.integer "user_sale_price", limit: 4, default: 0, null: false
  1155. t.string "share_content", limit: 50
  1156. t.string "share_img", limit: 255
  1157. t.datetime "seckill_start"
  1158. t.datetime "seckill_end"
  1159. t.integer "seckill_price", limit: 4
  1160. t.datetime "deliver_stop_at"
  1161. t.datetime "deliver_start_at"
  1162. t.boolean "is_only_new", default: false
  1163. t.string "specification", limit: 255
  1164. t.string "no_delivery_area", limit: 255, default: "西藏、新疆、内蒙、宁夏、青海、甘肃"
  1165. t.boolean "video_state", default: false
  1166. t.string "video_url", limit: 100
  1167. t.integer "sale_nums", limit: 4, default: 1, null: false
  1168. t.integer "size_id", limit: 4, default: 0, null: false
  1169. t.integer "color_id", limit: 4, default: 0, null: false
  1170. t.integer "relate_product_id", limit: 4
  1171. t.boolean "show_flag", default: false
  1172. t.boolean "live", default: false
  1173. t.boolean "package", default: false
  1174. t.integer "product_cycle", limit: 4, default: 0, null: false
  1175. t.integer "stock_cycle", limit: 4, default: 0, null: false
  1176. t.integer "min_purchase", limit: 4, default: 0, null: false
  1177. t.string "product_no", limit: 128, default: "", null: false
  1178. t.integer "pv", limit: 4, default: 0
  1179. t.integer "out_nums", limit: 4, default: 0
  1180. t.string "key_words", limit: 255, default: "0"
  1181. t.string "only_delivery_area", limit: 255, default: ""
  1182. t.integer "silver", limit: 4, default: 0
  1183. t.boolean "use_quan"
  1184. t.integer "sale_zone", limit: 8, default: 0
  1185. t.boolean "allow_app", default: false, null: false
  1186. t.string "name_en", limit: 255
  1187. t.string "name_ru", limit: 255
  1188. t.string "name_tw", limit: 255
  1189. t.text "detail_en", limit: 65535
  1190. t.text "detail_ru", limit: 65535
  1191. t.text "detail_tw", limit: 65535
  1192. end
  1193. add_index "products", ["allow_app"], name: "index_products_on_allow_app", using: :btree
  1194. add_index "products", ["category_id"], name: "index_products_on_category_id", using: :btree
  1195. add_index "products", ["color_id"], name: "index_products_on_color_id", using: :btree
  1196. add_index "products", ["recommend"], name: "Recommend", using: :btree
  1197. add_index "products", ["size_id"], name: "index_products_on_size_id", using: :btree
  1198. create_table "products_promotions", force: :cascade do |t|
  1199. t.integer "promotion_id", limit: 4
  1200. t.integer "product_id", limit: 4
  1201. end
  1202. add_index "products_promotions", ["promotion_id", "product_id"], name: "idx_pomotion_products_id", using: :btree
  1203. create_table "profit_users", force: :cascade do |t|
  1204. t.integer "wx_user_id", limit: 4, default: 0, null: false
  1205. t.string "openid", limit: 255
  1206. t.datetime "created_at"
  1207. t.datetime "updated_at"
  1208. end
  1209. add_index "profit_users", ["wx_user_id"], name: "index_profit_users_on_wx_user_id", using: :btree
  1210. create_table "promotions", force: :cascade do |t|
  1211. t.string "name", limit: 128
  1212. t.datetime "begin_time"
  1213. t.datetime "end_time"
  1214. t.boolean "is_first", default: true
  1215. t.boolean "is_more", default: true
  1216. t.integer "order_type", limit: 4, default: 0
  1217. t.integer "cash", limit: 4
  1218. t.integer "cent", limit: 4
  1219. t.integer "min_total", limit: 4, default: 0
  1220. t.integer "max_total", limit: 4, default: 0
  1221. t.integer "prod1", limit: 4, default: 0
  1222. t.integer "nums1", limit: 4, default: 0
  1223. t.integer "prod2", limit: 4, default: 0
  1224. t.integer "nums2", limit: 4, default: 0
  1225. t.integer "prod3", limit: 4, default: 0
  1226. t.integer "nums3", limit: 4, default: 0
  1227. t.integer "send_prod1", limit: 4, default: 0
  1228. t.integer "send_nums1", limit: 4, default: 0
  1229. t.integer "send_prod2", limit: 4, default: 0
  1230. t.integer "send_nums2", limit: 4, default: 0
  1231. t.integer "send_prod3", limit: 4, default: 0
  1232. t.integer "send_nums3", limit: 4, default: 0
  1233. t.boolean "is_enable", default: true
  1234. t.datetime "created_at"
  1235. t.datetime "updated_at"
  1236. t.integer "prod4", limit: 4
  1237. t.integer "nums4", limit: 4
  1238. t.integer "prod5", limit: 4
  1239. t.integer "nums5", limit: 4
  1240. t.integer "send_prod4", limit: 4
  1241. t.integer "send_nums4", limit: 4
  1242. t.integer "send_prod5", limit: 4
  1243. t.integer "send_nums5", limit: 4
  1244. t.integer "depart", limit: 4, default: 0, null: false
  1245. end
  1246. add_index "promotions", ["begin_time"], name: "index_promotions_on_begin_time", using: :btree
  1247. add_index "promotions", ["end_time"], name: "index_promotions_on_end_time", using: :btree
  1248. create_table "push_after_subs", force: :cascade do |t|
  1249. t.string "push_type", limit: 255, null: false
  1250. t.string "push_title", limit: 255
  1251. t.string "cover", limit: 255
  1252. t.text "word", limit: 65535
  1253. t.string "url", limit: 255
  1254. t.string "remark", limit: 255, null: false
  1255. t.datetime "created_at"
  1256. t.datetime "updated_at"
  1257. end
  1258. create_table "push_tmpl_records", force: :cascade do |t|
  1259. t.integer "wx_uid", limit: 4, null: false
  1260. t.datetime "push_time", null: false
  1261. t.integer "temp_id", limit: 4, null: false
  1262. end
  1263. add_index "push_tmpl_records", ["wx_uid"], name: "index_push_tmpl_records_on_wx_uid", using: :btree
  1264. create_table "push_tmpls", force: :cascade do |t|
  1265. t.text "user_id", limit: 65535
  1266. t.string "msg_type", limit: 255
  1267. t.boolean "push_force", default: false
  1268. t.integer "push_count", limit: 4, default: 0
  1269. t.integer "click_count", limit: 4, default: 0
  1270. t.string "first", limit: 255
  1271. t.string "keyword1", limit: 255
  1272. t.string "keyword2", limit: 255
  1273. t.string "keyword3", limit: 255
  1274. t.string "keyword4", limit: 255
  1275. t.string "keyword5", limit: 255
  1276. t.string "remark", limit: 255
  1277. t.string "url", limit: 255
  1278. t.integer "times", limit: 4, default: 0
  1279. t.datetime "last_updated_at"
  1280. t.integer "wx_gongzhonghao_id", limit: 4, default: 1
  1281. t.datetime "created_at"
  1282. t.datetime "updated_at"
  1283. end
  1284. create_table "rails_admin_histories", force: :cascade do |t|
  1285. t.text "message", limit: 65535
  1286. t.string "username", limit: 255
  1287. t.integer "item", limit: 4
  1288. t.string "table", limit: 255
  1289. t.integer "month", limit: 2
  1290. t.integer "year", limit: 8
  1291. t.datetime "created_at"
  1292. t.datetime "updated_at"
  1293. end
  1294. add_index "rails_admin_histories", ["item", "table", "month", "year"], name: "index_rails_admin_histories", using: :btree
  1295. create_table "random_excel", force: :cascade do |t|
  1296. t.string "user_no", limit: 256
  1297. t.integer "rand_id", limit: 8, default: 0
  1298. t.datetime "created_at"
  1299. t.datetime "updated_at"
  1300. end
  1301. create_table "recharge_cash_orders", force: :cascade do |t|
  1302. t.string "order_id", limit: 64, null: false
  1303. t.integer "user_id", limit: 4, null: false
  1304. t.integer "wx_user_id", limit: 4
  1305. t.string "pay_way", limit: 20
  1306. t.string "trade_no", limit: 64
  1307. t.integer "paied_at", limit: 4
  1308. t.integer "total_price", limit: 8, default: 0
  1309. t.boolean "state", default: false
  1310. t.string "remark", limit: 255
  1311. t.string "balance_bank_card_no", limit: 255
  1312. t.datetime "created_at"
  1313. t.datetime "updated_at"
  1314. end
  1315. add_index "recharge_cash_orders", ["order_id"], name: "index_recharge_cash_orders_on_order_id", using: :btree
  1316. add_index "recharge_cash_orders", ["user_id"], name: "index_recharge_cash_orders_on_user_id", using: :btree
  1317. add_index "recharge_cash_orders", ["wx_user_id"], name: "index_recharge_cash_orders_on_wx_user_id", using: :btree
  1318. create_table "reserve_act_orders", force: :cascade do |t|
  1319. t.integer "act_id", limit: 4, null: false
  1320. t.string "order_id", limit: 255, null: false
  1321. t.integer "total_price", limit: 8, default: 0
  1322. t.integer "paied_price", limit: 8, default: 0
  1323. t.integer "user_id", limit: 4, null: false
  1324. t.string "pay_way", limit: 20, default: "weixinpay"
  1325. t.string "trade_no", limit: 64
  1326. t.integer "paied_at", limit: 8
  1327. t.boolean "state", default: false
  1328. t.boolean "is_refunded", default: false
  1329. t.boolean "is_deleted", default: false
  1330. t.string "remark", limit: 255
  1331. t.integer "returned_amount", limit: 4, default: 0
  1332. t.integer "wx_user_id", limit: 4, null: false
  1333. t.datetime "created_at"
  1334. t.datetime "updated_at"
  1335. end
  1336. add_index "reserve_act_orders", ["act_id"], name: "index_reserve_act_orders_on_act_id", using: :btree
  1337. add_index "reserve_act_orders", ["order_id"], name: "index_reserve_act_orders_on_order_id", using: :btree
  1338. create_table "reserve_acts", force: :cascade do |t|
  1339. t.string "title", limit: 255, null: false
  1340. t.datetime "start_at", null: false
  1341. t.datetime "stop_at", null: false
  1342. t.text "background_detail", limit: 65535
  1343. t.string "remark", limit: 255
  1344. t.string "guide_url", limit: 255
  1345. t.string "guide_text", limit: 255
  1346. t.string "url_type", limit: 20
  1347. t.integer "state", limit: 4, default: 0
  1348. t.string "share_title", limit: 255
  1349. t.string "share_about", limit: 255
  1350. t.string "share_img", limit: 255
  1351. t.datetime "created_at"
  1352. t.datetime "updated_at"
  1353. t.integer "join_amount", limit: 4, default: 0
  1354. t.string "rule", limit: 255
  1355. t.boolean "is_returned", default: false
  1356. t.integer "return_count", limit: 4, default: 1, null: false
  1357. t.string "guide_img", limit: 255
  1358. end
  1359. create_table "scale_devices", force: :cascade do |t|
  1360. t.integer "wx_user_id", limit: 4
  1361. t.string "mac_addr", limit: 100
  1362. t.string "device_name", limit: 100
  1363. t.datetime "created_at", precision: 3
  1364. t.datetime "updated_at", precision: 3
  1365. t.datetime "deleted_at", precision: 3
  1366. t.boolean "active", default: true
  1367. end
  1368. add_index "scale_devices", ["deleted_at"], name: "idx_scale_devices_deleted_at", using: :btree
  1369. create_table "scale_result", force: :cascade do |t|
  1370. t.integer "wx_user_id", limit: 4
  1371. t.text "result", limit: 65535
  1372. t.datetime "created_at", precision: 3
  1373. t.datetime "updated_at", precision: 3
  1374. t.datetime "deleted_at", precision: 3
  1375. t.integer "user_id", limit: 8
  1376. end
  1377. add_index "scale_result", ["deleted_at"], name: "idx_scale_result_deleted_at", using: :btree
  1378. create_table "scale_users", force: :cascade do |t|
  1379. t.datetime "created_at", precision: 3
  1380. t.datetime "updated_at", precision: 3
  1381. t.integer "wx_user_id", limit: 8
  1382. t.integer "device_id", limit: 2
  1383. t.integer "sex", limit: 2
  1384. t.boolean "active", default: true
  1385. t.string "avatar", limit: 256
  1386. t.string "nick_name", limit: 100
  1387. t.string "height", limit: 100
  1388. t.string "weight", limit: 100, default: ""
  1389. t.string "age", limit: 100
  1390. t.string "target_weight", limit: 100
  1391. t.string "birthday", limit: 191
  1392. t.string "country", limit: 50
  1393. t.string "race", limit: 50
  1394. t.string "occupation", limit: 100
  1395. end
  1396. create_table "session", primary_key: "session_key", force: :cascade do |t|
  1397. t.binary "session_data", limit: 65535
  1398. t.integer "session_expiry", limit: 4, null: false
  1399. end
  1400. create_table "share_infos", force: :cascade do |t|
  1401. t.string "share_code", limit: 255, null: false
  1402. t.string "relate_id", limit: 255, null: false
  1403. t.string "relate_parent", limit: 255, null: false
  1404. t.integer "wx_user_id", limit: 4, default: 0
  1405. t.string "share_to", limit: 20, null: false
  1406. t.string "ip", limit: 255, null: false
  1407. t.datetime "created_at"
  1408. t.datetime "updated_at"
  1409. t.integer "share_times", limit: 4, default: 0
  1410. t.datetime "share_latest_time"
  1411. end
  1412. add_index "share_infos", ["relate_id"], name: "index_share_infos_on_relate_id", using: :btree
  1413. add_index "share_infos", ["relate_parent"], name: "index_share_infos_on_relate_parent", using: :btree
  1414. add_index "share_infos", ["share_code"], name: "index_share_infos_on_share_code", using: :btree
  1415. create_table "share_materials", force: :cascade do |t|
  1416. t.integer "wx_uid", limit: 4, null: false
  1417. t.string "image_1st", limit: 255
  1418. t.string "image_2nd", limit: 255
  1419. t.string "image_3rd", limit: 255
  1420. t.string "image_4th", limit: 255
  1421. t.string "image_5th", limit: 255
  1422. t.string "image_6th", limit: 255
  1423. t.string "image_7th", limit: 255
  1424. t.string "image_8th", limit: 255
  1425. t.boolean "is_published", default: false
  1426. t.datetime "created_at"
  1427. t.datetime "updated_at"
  1428. t.string "image_9th", limit: 255
  1429. t.string "m_type", limit: 20, default: "product", null: false
  1430. t.integer "type_id", limit: 4, null: false
  1431. t.text "material_text", limit: 65535
  1432. end
  1433. add_index "share_materials", ["wx_uid"], name: "index_share_materials_on_wx_uid", using: :btree
  1434. create_table "shop_applications", force: :cascade do |t|
  1435. t.integer "user_id", limit: 8, default: 0
  1436. t.integer "wx_user_id", limit: 8, default: 0
  1437. t.string "nickname", limit: 255
  1438. t.string "name", limit: 255
  1439. t.integer "mobile", limit: 8, default: 0
  1440. t.integer "total", limit: 4, default: 0
  1441. t.string "address", limit: 255
  1442. t.string "remark", limit: 255
  1443. t.string "image", limit: 255
  1444. t.boolean "status", default: true
  1445. t.datetime "pass_time"
  1446. t.datetime "created_at"
  1447. t.datetime "updated_at"
  1448. t.integer "calc_flag", limit: 4
  1449. t.integer "depart", limit: 4
  1450. t.integer "link_flag", limit: 4, default: 0
  1451. end
  1452. add_index "shop_applications", ["depart"], name: "index_shop_applications_on_depart", using: :btree
  1453. add_index "shop_applications", ["pass_time"], name: "index_shop_applicatio_pass_time", using: :btree
  1454. add_index "shop_applications", ["user_id"], name: "index_shop_applications_on_user_id", using: :btree
  1455. add_index "shop_applications", ["wx_user_id"], name: "index_shop_applications_on_wx_user_id", using: :btree
  1456. create_table "shop_promotions", force: :cascade do |t|
  1457. t.string "name", limit: 128
  1458. t.datetime "begin_time"
  1459. t.datetime "end_time"
  1460. t.integer "depart", limit: 4, default: 0, null: false
  1461. t.integer "total", limit: 4, default: 0
  1462. t.integer "cash", limit: 4, default: 0
  1463. t.integer "cent", limit: 4, default: 0
  1464. t.integer "send_prod1", limit: 4, default: 0
  1465. t.integer "send_nums1", limit: 4, default: 0
  1466. t.integer "send_prod2", limit: 4, default: 0
  1467. t.integer "send_nums2", limit: 4, default: 0
  1468. t.integer "send_prod3", limit: 4, default: 0
  1469. t.integer "send_nums3", limit: 4, default: 0
  1470. t.integer "send_prod4", limit: 4, default: 0
  1471. t.integer "send_nums4", limit: 4, default: 0
  1472. t.integer "send_prod5", limit: 4, default: 0
  1473. t.integer "send_nums5", limit: 4, default: 0
  1474. t.boolean "is_enable", default: true
  1475. t.datetime "created_at"
  1476. t.datetime "updated_at"
  1477. end
  1478. add_index "shop_promotions", ["begin_time"], name: "index_shop_promotions_on_begin_time", using: :btree
  1479. add_index "shop_promotions", ["end_time"], name: "index_shop_promotions_on_end_time", using: :btree
  1480. add_index "shop_promotions", ["total"], name: "index_shop_promotions_on_total", using: :btree
  1481. create_table "sign_up_channel_qrcode_results", force: :cascade do |t|
  1482. t.integer "wx_uid", limit: 4, default: 0, null: false
  1483. t.integer "sign_up_channel_id", limit: 4
  1484. t.datetime "created_at"
  1485. t.datetime "updated_at"
  1486. end
  1487. 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
  1488. 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
  1489. add_index "sign_up_channel_qrcode_results", ["wx_uid"], name: "index_sign_up_channel_qrcode_results_on_wx_uid", using: :btree
  1490. create_table "sign_up_channels", force: :cascade do |t|
  1491. t.integer "parent_id", limit: 4, default: 0, null: false
  1492. t.string "channel_value", limit: 255
  1493. t.string "channel_url", limit: 255
  1494. t.datetime "created_at", null: false
  1495. t.datetime "updated_at", null: false
  1496. t.string "url_image", limit: 255
  1497. t.integer "scan_times", limit: 4, default: 0, null: false
  1498. t.integer "invite_id", limit: 4, default: 0
  1499. end
  1500. create_table "silvers", force: :cascade do |t|
  1501. t.integer "user_id", limit: 4
  1502. t.integer "wx_user_id", limit: 4
  1503. t.integer "count", limit: 4
  1504. t.string "source", limit: 64
  1505. t.string "relate_id", limit: 255
  1506. t.string "remark", limit: 255
  1507. t.datetime "created_at"
  1508. t.datetime "updated_at"
  1509. end
  1510. add_index "silvers", ["user_id"], name: "index_silvers_on_user_id", using: :btree
  1511. add_index "silvers", ["wx_user_id"], name: "index_silvers_on_wx_user_id", using: :btree
  1512. create_table "static_foods", force: :cascade do |t|
  1513. t.datetime "created_at", precision: 3
  1514. t.datetime "updated_at", precision: 3
  1515. t.string "food_date", limit: 191
  1516. t.integer "source", limit: 2
  1517. t.integer "nums", limit: 8
  1518. t.integer "pre_nums", limit: 8
  1519. t.integer "single_nums", limit: 8
  1520. t.integer "total", limit: 8
  1521. t.integer "comfirm_nums", limit: 8
  1522. end
  1523. create_table "store_records", force: :cascade do |t|
  1524. t.datetime "date_time"
  1525. t.string "no", limit: 255
  1526. t.integer "product_id", limit: 4, default: 0, null: false
  1527. t.integer "order_type", limit: 4, default: 0, null: false
  1528. t.integer "nums", limit: 4, default: 0, null: false
  1529. t.string "operator", limit: 255
  1530. t.string "remark", limit: 255
  1531. t.datetime "created_at"
  1532. t.datetime "updated_at"
  1533. end
  1534. create_table "string_job_baks", force: :cascade do |t|
  1535. t.string "random_string", limit: 128
  1536. t.string "qr_string", limit: 255
  1537. t.datetime "created_at", precision: 6, null: false
  1538. t.datetime "updated_at", precision: 6, null: false
  1539. end
  1540. add_index "string_job_baks", ["random_string"], name: "index_string_jobs_on_random_string", unique: true, using: :btree
  1541. create_table "string_jobs", force: :cascade do |t|
  1542. t.string "random_string", limit: 128
  1543. t.string "qr_string", limit: 255
  1544. t.datetime "created_at", precision: 6, null: false
  1545. t.datetime "updated_at", precision: 6, null: false
  1546. end
  1547. add_index "string_jobs", ["random_string"], name: "index_string_jobs_on_random_string", unique: true, using: :btree
  1548. create_table "sys_cents", force: :cascade do |t|
  1549. t.integer "user_id", limit: 4, null: false
  1550. t.integer "cent", limit: 4, null: false
  1551. t.integer "balance", limit: 4, null: false
  1552. t.integer "cash", limit: 4, null: false
  1553. end
  1554. add_index "sys_cents", ["user_id"], name: "index_sys_cents_on_user_id", using: :btree
  1555. create_table "sys_configs", force: :cascade do |t|
  1556. t.string "code", limit: 64
  1557. t.integer "config_type", limit: 4, default: 0
  1558. t.string "code_value", limit: 64
  1559. t.integer "sort", limit: 4, default: 0
  1560. t.integer "depart_record_id", limit: 4, default: 0
  1561. t.string "descrption", limit: 128
  1562. t.datetime "created_at"
  1563. t.datetime "updated_at"
  1564. end
  1565. add_index "sys_configs", ["code"], name: "idx_code", using: :btree
  1566. create_table "sys_users", force: :cascade do |t|
  1567. t.integer "invite_id", limit: 4, null: false
  1568. t.string "user_no", limit: 128
  1569. t.string "invite_no", limit: 128
  1570. t.string "dengji", limit: 128
  1571. t.boolean "show_invite_mode", default: false
  1572. t.integer "rank", limit: 4, null: false
  1573. t.datetime "created_at"
  1574. t.datetime "updated_at"
  1575. end
  1576. add_index "sys_users", ["invite_id"], name: "index_sys_users_on_invite_id", using: :btree
  1577. create_table "take_cash_orders", force: :cascade do |t|
  1578. t.integer "wx_uid", limit: 4, null: false
  1579. t.string "order_id", limit: 64, null: false
  1580. t.string "trade_no", limit: 64
  1581. t.integer "count", limit: 8, default: 0
  1582. t.integer "pay_state", limit: 1, default: 0
  1583. t.integer "audit_state", limit: 1, default: 0
  1584. t.integer "paied_at", limit: 4
  1585. t.string "remark", limit: 255
  1586. t.datetime "created_at"
  1587. t.datetime "updated_at"
  1588. t.datetime "expc_pay_at"
  1589. t.string "account_name", limit: 200
  1590. t.string "bank_account", limit: 200, default: "", null: false
  1591. t.string "bank_name", limit: 200
  1592. t.integer "real_state", limit: 4
  1593. t.integer "user_id", limit: 4
  1594. t.string "tel", limit: 255
  1595. t.integer "fee", limit: 4, default: 0
  1596. t.integer "fei_count", limit: 4, default: 0
  1597. t.integer "free_count", limit: 4, default: 0
  1598. end
  1599. add_index "take_cash_orders", ["order_id"], name: "index_take_cash_orders_on_order_id", using: :btree
  1600. add_index "take_cash_orders", ["wx_uid"], name: "index_take_cash_orders_on_wx_uid", using: :btree
  1601. create_table "tcm_exam_messages", force: :cascade do |t|
  1602. t.datetime "created_at", precision: 3
  1603. t.datetime "updated_at", precision: 3
  1604. t.integer "exam_id", limit: 8
  1605. t.integer "wx_user_id", limit: 8
  1606. t.string "role", limit: 16
  1607. t.string "message_type", limit: 32
  1608. t.text "content", limit: 4294967295
  1609. t.text "metadata", limit: 4294967295
  1610. end
  1611. add_index "tcm_exam_messages", ["exam_id"], name: "idx_tcm_exam_messages_exam", using: :btree
  1612. add_index "tcm_exam_messages", ["exam_id"], name: "idx_tcm_exam_messages_exam_id", using: :btree
  1613. add_index "tcm_exam_messages", ["wx_user_id"], name: "idx_tcm_exam_messages_wx_user", using: :btree
  1614. add_index "tcm_exam_messages", ["wx_user_id"], name: "idx_tcm_exam_messages_wx_user_id", using: :btree
  1615. create_table "tcm_exams", force: :cascade do |t|
  1616. t.datetime "created_at", precision: 3
  1617. t.datetime "updated_at", precision: 3
  1618. t.integer "wx_user_id", limit: 8
  1619. t.integer "scale_user_id", limit: 8
  1620. t.string "model", limit: 64, default: "gemini-3-pro-preview"
  1621. t.string "status", limit: 32, default: "pending"
  1622. t.text "question_answers", limit: 4294967295
  1623. t.text "observation_images", limit: 4294967295
  1624. t.text "latest_scale_result", limit: 4294967295
  1625. t.text "extra_note", limit: 4294967295
  1626. t.text "ai_summary", limit: 4294967295
  1627. t.text "report_html", limit: 4294967295
  1628. t.string "language", limit: 16, default: "zh"
  1629. t.text "raw_request", limit: 65535
  1630. end
  1631. add_index "tcm_exams", ["scale_user_id"], name: "idx_tcm_exams_scale_user", using: :btree
  1632. add_index "tcm_exams", ["scale_user_id"], name: "idx_tcm_exams_scale_user_id", using: :btree
  1633. add_index "tcm_exams", ["wx_user_id"], name: "idx_tcm_exams_wx_user", using: :btree
  1634. add_index "tcm_exams", ["wx_user_id"], name: "idx_tcm_exams_wx_user_id", using: :btree
  1635. create_table "three_wx_users", force: :cascade do |t|
  1636. t.integer "invite_id", limit: 4, default: 0
  1637. t.datetime "created_at"
  1638. t.datetime "updated_at"
  1639. t.text "intro_inner_no", limit: 65535
  1640. t.string "intro_area", limit: 30
  1641. t.integer "invite_rank", limit: 4
  1642. t.integer "depart", limit: 4, default: 0, null: false
  1643. t.integer "show_invite_mode", limit: 4, default: 0
  1644. t.integer "intro_user_Id", limit: 4, default: 0
  1645. end
  1646. add_index "three_wx_users", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  1647. add_index "three_wx_users", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  1648. add_index "three_wx_users", ["invite_rank"], name: "index_wx_users_on_invite_rank", using: :btree
  1649. create_table "update_orders", force: :cascade do |t|
  1650. t.string "order_id", limit: 256
  1651. t.string "express_order_no", limit: 256
  1652. t.string "express_company", limit: 256
  1653. t.boolean "status", default: true
  1654. t.datetime "created_at"
  1655. t.datetime "updated_at"
  1656. end
  1657. create_table "user_perfomances", force: :cascade do |t|
  1658. t.datetime "begin_date"
  1659. t.datetime "end_date"
  1660. t.integer "wx_user_id", limit: 4, default: 0
  1661. t.string "nickname", limit: 256
  1662. t.integer "order_perfomance", limit: 4, default: 0
  1663. t.integer "shop_order_perfomance", limit: 4, default: 0
  1664. t.integer "shop_perfomance", limit: 4, default: 0
  1665. t.integer "balance_perfomance", limit: 4, default: 0
  1666. t.integer "total", limit: 4, default: 0
  1667. t.integer "nums", limit: 4, default: 0, null: false
  1668. t.datetime "created_at"
  1669. t.datetime "updated_at"
  1670. end
  1671. add_index "user_perfomances", ["wx_user_id"], name: "index_user_perfomances_on_wx_user_id", using: :btree
  1672. create_table "user_tokens", force: :cascade do |t|
  1673. t.integer "user_id", limit: 4, null: false
  1674. t.string "token", limit: 255, null: false
  1675. t.integer "expire_time", limit: 4, default: 0, null: false
  1676. t.datetime "created_at"
  1677. t.datetime "updated_at"
  1678. end
  1679. add_index "user_tokens", ["user_id"], name: "index_user_tokens_on_user_id", using: :btree
  1680. create_table "users", force: :cascade do |t|
  1681. t.string "tel", limit: 20
  1682. t.string "country_code", limit: 10, default: "86", null: false
  1683. t.string "email", limit: 191
  1684. t.string "trade_pwd", limit: 255, default: "", null: false
  1685. t.string "pwd", limit: 255, default: ""
  1686. t.string "real_name", limit: 64
  1687. t.string "identity_card", limit: 18
  1688. t.boolean "is_certification", default: false
  1689. t.date "birthday"
  1690. t.string "nickname", limit: 100
  1691. t.string "city", limit: 20
  1692. t.string "country", limit: 20
  1693. t.string "province", limit: 20
  1694. t.integer "sex", limit: 1, default: 0
  1695. t.integer "age", limit: 4
  1696. t.string "head", limit: 255
  1697. t.integer "invite_id", limit: 4
  1698. t.integer "signup_channel_id", limit: 4, default: 0, null: false
  1699. t.string "signup_ip", limit: 255
  1700. t.datetime "created_at"
  1701. t.datetime "updated_at"
  1702. t.boolean "is_black_user", default: false
  1703. t.string "bank_name", limit: 200
  1704. t.string "bank_account", limit: 200
  1705. t.string "account_name", limit: 200
  1706. t.string "race", limit: 32
  1707. t.string "occupation", limit: 100
  1708. end
  1709. add_index "users", ["invite_id"], name: "index_users_on_invite_id", using: :btree
  1710. create_table "users_backup", force: :cascade do |t|
  1711. t.string "tel", limit: 20
  1712. t.string "trade_pwd", limit: 255, default: "", null: false
  1713. t.string "pwd", limit: 255, default: ""
  1714. t.string "real_name", limit: 64
  1715. t.string "identity_card", limit: 18
  1716. t.boolean "is_certification", default: false
  1717. t.date "birthday"
  1718. t.string "nickname", limit: 100
  1719. t.string "city", limit: 20
  1720. t.string "country", limit: 20
  1721. t.string "province", limit: 20
  1722. t.integer "sex", limit: 1, default: 0
  1723. t.integer "age", limit: 4
  1724. t.string "head", limit: 255
  1725. t.integer "invite_id", limit: 4
  1726. t.integer "signup_channel_id", limit: 4, default: 0, null: false
  1727. t.string "signup_ip", limit: 255
  1728. t.datetime "created_at"
  1729. t.datetime "updated_at"
  1730. t.boolean "is_black_user", default: false
  1731. t.string "bank_name", limit: 200
  1732. t.string "bank_account", limit: 200
  1733. t.string "account_name", limit: 200
  1734. end
  1735. add_index "users_backup", ["invite_id"], name: "index_users_on_invite_id", using: :btree
  1736. create_table "version_associations", force: :cascade do |t|
  1737. t.integer "version_id", limit: 4
  1738. t.string "foreign_key_name", limit: 255, null: false
  1739. t.integer "foreign_key_id", limit: 4
  1740. end
  1741. add_index "version_associations", ["foreign_key_name", "foreign_key_id"], name: "index_version_associations_on_foreign_key", using: :btree
  1742. add_index "version_associations", ["version_id"], name: "index_version_associations_on_version_id", using: :btree
  1743. create_table "versions", force: :cascade do |t|
  1744. t.string "item_type", limit: 191, null: false
  1745. t.integer "item_id", limit: 4, null: false
  1746. t.string "event", limit: 255, null: false
  1747. t.string "whodunnit", limit: 255
  1748. t.text "object", limit: 4294967295
  1749. t.datetime "created_at"
  1750. t.text "object_changes", limit: 4294967295
  1751. t.integer "transaction_id", limit: 4
  1752. end
  1753. add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
  1754. add_index "versions", ["transaction_id"], name: "index_versions_on_transaction_id", using: :btree
  1755. create_table "welfare_orders", force: :cascade do |t|
  1756. t.integer "welfare_id", limit: 4, null: false
  1757. t.integer "product_id", limit: 4, null: false
  1758. t.string "order_id", limit: 255, null: false
  1759. t.integer "wx_uid", limit: 4, null: false
  1760. t.integer "total_price", limit: 4, null: false
  1761. t.integer "paied_price", limit: 4, default: 0
  1762. t.integer "paied_at", limit: 4
  1763. t.integer "state", limit: 1, default: 0
  1764. t.string "trade_no", limit: 255
  1765. t.string "remark", limit: 255
  1766. t.integer "invite_wx_uid", limit: 4
  1767. t.datetime "created_at"
  1768. t.datetime "updated_at"
  1769. end
  1770. add_index "welfare_orders", ["order_id"], name: "index_welfare_orders_on_order_id", using: :btree
  1771. add_index "welfare_orders", ["welfare_id"], name: "index_welfare_orders_on_welfare_id", using: :btree
  1772. add_index "welfare_orders", ["wx_uid"], name: "index_welfare_orders_on_wx_uid", using: :btree
  1773. create_table "wx_event_items", force: :cascade do |t|
  1774. t.integer "article_id", limit: 4, null: false
  1775. t.string "name", limit: 100, null: false
  1776. t.string "title", limit: 255
  1777. t.boolean "use_title", default: false
  1778. t.string "cover", limit: 255
  1779. t.boolean "use_cover", default: false
  1780. t.string "href", limit: 255
  1781. t.boolean "use_href", default: false
  1782. t.integer "position", limit: 4
  1783. t.integer "click_times", limit: 4
  1784. t.string "ancestry", limit: 100
  1785. t.boolean "state", default: false
  1786. end
  1787. add_index "wx_event_items", ["ancestry"], name: "index_wx_event_items_on_ancestry", using: :btree
  1788. create_table "wx_events", force: :cascade do |t|
  1789. t.integer "wx_gongzhonghao_id", limit: 4, null: false
  1790. t.string "return_type", limit: 4, null: false
  1791. t.string "key", limit: 255
  1792. t.integer "wx_event_item_id", limit: 4
  1793. t.text "return_text_content", limit: 65535
  1794. t.boolean "state", default: false
  1795. t.datetime "created_at"
  1796. t.datetime "updated_at"
  1797. end
  1798. add_index "wx_events", ["key"], name: "index_wx_events_on_key", using: :btree
  1799. add_index "wx_events", ["wx_gongzhonghao_id"], name: "index_wx_events_on_wx_gongzhonghao_id", using: :btree
  1800. create_table "wx_form_ids", force: :cascade do |t|
  1801. t.string "mp_openid", limit: 128
  1802. t.string "openid", limit: 128
  1803. t.string "form_id", limit: 100
  1804. t.boolean "state", default: false
  1805. t.datetime "created_at"
  1806. t.datetime "updated_at"
  1807. end
  1808. add_index "wx_form_ids", ["form_id"], name: "form_id", unique: true, using: :btree
  1809. create_table "wx_gongzhonghaos", force: :cascade do |t|
  1810. t.string "wx_hao", limit: 255, null: false
  1811. t.string "wx_name", limit: 255, null: false
  1812. t.string "wx_type", limit: 9, default: "service", null: false
  1813. t.boolean "is_authed", default: false
  1814. t.string "app_id", limit: 255, null: false
  1815. t.string "app_secret", limit: 255
  1816. t.string "token", limit: 255
  1817. t.text "sub_return_text", limit: 65535
  1818. t.datetime "created_at"
  1819. t.datetime "updated_at"
  1820. end
  1821. add_index "wx_gongzhonghaos", ["app_id"], name: "index_wx_gongzhonghaos_on_app_id", unique: true, using: :btree
  1822. add_index "wx_gongzhonghaos", ["wx_hao"], name: "index_wx_gongzhonghaos_on_wx_hao", unique: true, using: :btree
  1823. create_table "wx_menus", force: :cascade do |t|
  1824. t.integer "wx_gongzhonghao_id", limit: 4, null: false
  1825. t.string "name", limit: 255
  1826. t.string "ancestry", limit: 64
  1827. t.text "content", limit: 65535
  1828. t.string "action", limit: 15, default: "view"
  1829. t.datetime "created_at"
  1830. t.string "key", limit: 255
  1831. t.integer "position", limit: 4
  1832. t.string "appid", limit: 255
  1833. t.string "pagepath", limit: 255
  1834. end
  1835. add_index "wx_menus", ["ancestry"], name: "index_wx_menus_on_ancestry", using: :btree
  1836. add_index "wx_menus", ["wx_gongzhonghao_id"], name: "index_wx_menus_on_wx_gongzhonghao_id", using: :btree
  1837. create_table "wx_user_gongzhonghaos", force: :cascade do |t|
  1838. t.integer "wx_user_id", limit: 4, null: false
  1839. t.string "app_id", limit: 255, null: false
  1840. t.string "gzh_open_id", limit: 64
  1841. t.datetime "created_at"
  1842. t.datetime "updated_at"
  1843. t.boolean "subscribe"
  1844. t.integer "subscribe_time", limit: 4
  1845. t.integer "unsubscribe_time", limit: 4
  1846. t.integer "last_conversation_at", limit: 4
  1847. end
  1848. add_index "wx_user_gongzhonghaos", ["app_id"], name: "index_wx_user_gongzhonghaos_on_app_id", using: :btree
  1849. add_index "wx_user_gongzhonghaos", ["gzh_open_id"], name: "index_wx_user_gongzhonghaos_on_gzh_open_id", using: :btree
  1850. add_index "wx_user_gongzhonghaos", ["wx_user_id"], name: "index_wx_user_gongzhonghaos_on_wx_user_id", unique: true, using: :btree
  1851. create_table "wx_user_rank", force: :cascade do |t|
  1852. t.datetime "created_at", precision: 3
  1853. t.datetime "updated_at", precision: 3
  1854. t.integer "rank", limit: 8, null: false
  1855. t.string "rank_name", limit: 64, default: "", null: false
  1856. t.integer "quota_5h", limit: 8, default: 0, null: false
  1857. t.integer "quota_month", limit: 8, default: 0, null: false
  1858. end
  1859. add_index "wx_user_rank", ["rank"], name: "idx_wx_user_rank_rank", unique: true, using: :btree
  1860. create_table "wx_users", force: :cascade do |t|
  1861. t.integer "user_id", limit: 4
  1862. t.integer "invite_id", limit: 4, default: 0
  1863. t.string "mp_openid", limit: 64
  1864. t.string "openid", limit: 255
  1865. t.string "nickname", limit: 100
  1866. t.string "unionid", limit: 64
  1867. t.string "city", limit: 20
  1868. t.string "country", limit: 20
  1869. t.string "province", limit: 20
  1870. t.integer "sex", limit: 1, default: 0
  1871. t.string "head", limit: 255
  1872. t.boolean "subscribe"
  1873. t.boolean "is_regist", default: false
  1874. t.integer "subscribe_time", limit: 4, default: 0
  1875. t.integer "unsubscribe_time", limit: 4, default: 0
  1876. t.integer "last_conversation_at", limit: 4, default: 0
  1877. t.integer "channel_qrcode_id", limit: 4
  1878. t.string "signup_ip", limit: 255
  1879. t.string "invite_qrcode_url", limit: 255
  1880. t.boolean "show_invite_mode", default: false
  1881. t.datetime "created_at"
  1882. t.datetime "updated_at"
  1883. t.integer "intro_user_id", limit: 4
  1884. t.text "intro_inner_no", limit: 65535
  1885. t.string "intro_area", limit: 3
  1886. t.integer "depth", limit: 4, default: 0, null: false
  1887. t.decimal "sale_group", precision: 20, scale: 2, null: false
  1888. t.decimal "sale_group_sum", precision: 20, scale: 2, null: false
  1889. t.decimal "sale_score", precision: 20, scale: 2
  1890. t.decimal "sale_person", precision: 20, scale: 2
  1891. t.integer "active_nums", limit: 4
  1892. t.integer "rank", limit: 8, default: 0
  1893. t.integer "partner_time", limit: 4, default: 0, null: false
  1894. t.string "user_no", limit: 128
  1895. t.integer "depart", limit: 4
  1896. t.string "tel", limit: 20
  1897. t.decimal "sale_shop", precision: 20, scale: 2
  1898. t.decimal "sale_shop_sum", precision: 20, scale: 2
  1899. t.decimal "sale_6", precision: 20, scale: 2, null: false
  1900. t.decimal "sale_7", precision: 20, scale: 2, null: false
  1901. t.string "tc_area", limit: 255, default: ""
  1902. t.integer "tc_bl", limit: 4, default: 0
  1903. t.integer "vip_rank", limit: 4, default: 1
  1904. t.datetime "vip_end_date"
  1905. end
  1906. add_index "wx_users", ["depart"], name: "index_wx_users_on_depart", using: :btree
  1907. add_index "wx_users", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  1908. add_index "wx_users", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  1909. add_index "wx_users", ["subscribe"], name: "index_wx_users_on_subscribe", using: :btree
  1910. add_index "wx_users", ["user_id"], name: "index_wx_users_on_user_id", using: :btree
  1911. create_table "wx_users_backup", force: :cascade do |t|
  1912. t.integer "user_id", limit: 4
  1913. t.integer "invite_id", limit: 4, default: 0
  1914. t.string "mp_openid", limit: 64
  1915. t.string "openid", limit: 64
  1916. t.string "nickname", limit: 100
  1917. t.string "unionid", limit: 64, null: false
  1918. t.string "city", limit: 20
  1919. t.string "country", limit: 20
  1920. t.string "province", limit: 20
  1921. t.integer "sex", limit: 1, default: 0
  1922. t.string "head", limit: 255
  1923. t.boolean "subscribe"
  1924. t.boolean "is_regist", default: false
  1925. t.integer "subscribe_time", limit: 4, default: 0
  1926. t.integer "unsubscribe_time", limit: 4, default: 0
  1927. t.integer "last_conversation_at", limit: 4, default: 0
  1928. t.integer "channel_qrcode_id", limit: 4
  1929. t.string "signup_ip", limit: 255
  1930. t.string "invite_qrcode_url", limit: 255
  1931. t.boolean "show_invite_mode", default: false
  1932. t.datetime "created_at"
  1933. t.datetime "updated_at"
  1934. t.integer "intro_user_id", limit: 4
  1935. t.text "intro_inner_no", limit: 65535
  1936. t.string "intro_area", limit: 3
  1937. t.integer "depth", limit: 4, default: 0, null: false
  1938. t.decimal "sale_group", precision: 20, scale: 2, null: false
  1939. t.decimal "sale_group_sum", precision: 20, scale: 2, null: false
  1940. t.decimal "sale_score", precision: 20, scale: 2
  1941. t.decimal "sale_person", precision: 20, scale: 2
  1942. t.integer "active_nums", limit: 4
  1943. t.integer "rank", limit: 8, default: 0
  1944. t.integer "partner_time", limit: 4, default: 0, null: false
  1945. t.string "user_no", limit: 128
  1946. t.integer "depart", limit: 4
  1947. t.string "tel", limit: 20
  1948. t.decimal "sale_shop", precision: 20, scale: 2
  1949. t.decimal "sale_shop_sum", precision: 20, scale: 2
  1950. t.decimal "sale_6", precision: 20, scale: 2, null: false
  1951. t.decimal "sale_7", precision: 20, scale: 2, null: false
  1952. t.string "tc_area", limit: 255, default: ""
  1953. t.integer "tc_bl", limit: 4, default: 0
  1954. end
  1955. add_index "wx_users_backup", ["channel_qrcode_id"], name: "index_wx_users_on_channel_qrcode_id", using: :btree
  1956. add_index "wx_users_backup", ["depart"], name: "index_wx_users_on_depart", using: :btree
  1957. add_index "wx_users_backup", ["intro_area"], name: "index_wx_users_on_intro_area", using: :btree
  1958. add_index "wx_users_backup", ["invite_id"], name: "index_wx_users_on_invite_id", using: :btree
  1959. add_index "wx_users_backup", ["last_conversation_at"], name: "index_wx_users_on_last_conversation_at", using: :btree
  1960. add_index "wx_users_backup", ["mp_openid"], name: "index_wx_users_on_mp_openid", using: :btree
  1961. add_index "wx_users_backup", ["subscribe"], name: "index_wx_users_on_subscribe", using: :btree
  1962. add_index "wx_users_backup", ["unionid"], name: "index_wx_users_on_unionid", unique: true, using: :btree
  1963. add_index "wx_users_backup", ["user_id"], name: "index_wx_users_on_user_id", using: :btree
  1964. create_table "wxku_commodities", force: :cascade do |t|
  1965. t.integer "product_id", limit: 4, null: false
  1966. t.string "image_info_1", limit: 255
  1967. t.string "image_info_2", limit: 255
  1968. t.string "image_info_3", limit: 255
  1969. t.string "image_info_4", limit: 255
  1970. t.string "image_info_5", limit: 255
  1971. t.string "category_info", limit: 255, default: "食品生鲜"
  1972. t.string "official_category_info", limit: 255, default: "食品生鲜"
  1973. t.string "url", limit: 255, default: "pages/start/start?scene="
  1974. t.string "title", limit: 30
  1975. t.string "sub_title", limit: 30
  1976. t.string "brand", limit: 255, default: "拉比兔"
  1977. t.integer "source", limit: 4, default: 1, null: false
  1978. t.string "desc", limit: 300
  1979. t.integer "min_price", limit: 4
  1980. t.integer "max_price", limit: 4
  1981. t.integer "min_ori_price", limit: 4
  1982. t.integer "max_ori_price", limit: 4
  1983. t.string "sale_status", limit: 255
  1984. t.string "status_ticket", limit: 255
  1985. t.integer "stock", limit: 4
  1986. t.datetime "created_at"
  1987. t.datetime "updated_at"
  1988. end
  1989. add_index "wxku_commodities", ["product_id"], name: "index_wxku_commodities_on_product_id", using: :btree
  1990. create_table "xcx_push_tmpl_records", force: :cascade do |t|
  1991. t.integer "wx_uid", limit: 4, null: false
  1992. t.datetime "push_time", null: false
  1993. t.integer "temp_id", limit: 4, null: false
  1994. end
  1995. add_index "xcx_push_tmpl_records", ["wx_uid"], name: "index_xcx_push_tmpl_records_on_wx_uid", using: :btree
  1996. create_table "xcx_push_tmpls", force: :cascade do |t|
  1997. t.text "user_id", limit: 65535
  1998. t.string "msg_type", limit: 255
  1999. t.boolean "push_force", default: false
  2000. t.string "emphasis_keyword", limit: 255
  2001. t.string "keyword1", limit: 255
  2002. t.string "keyword2", limit: 255
  2003. t.string "keyword3", limit: 255
  2004. t.string "keyword4", limit: 255
  2005. t.string "keyword5", limit: 255
  2006. t.string "page", limit: 255
  2007. t.integer "times", limit: 4, default: 0
  2008. t.datetime "last_updated_at"
  2009. t.datetime "created_at"
  2010. t.datetime "updated_at"
  2011. end
  2012. create_table "xcx_versions", force: :cascade do |t|
  2013. t.string "version", limit: 64, null: false
  2014. t.string "desc", limit: 255
  2015. t.boolean "state", default: false
  2016. t.datetime "created_at"
  2017. t.datetime "updated_at"
  2018. end
  2019. add_index "xcx_versions", ["version"], name: "index_xcx_versions_on_version", unique: true, using: :btree
  2020. create_table "积分资料201130", id: false, force: :cascade do |t|
  2021. t.string "user_id", limit: 255
  2022. t.string "cent", limit: 255
  2023. t.string "balance", limit: 255
  2024. t.string "cash", limit: 255
  2025. t.string "f5", limit: 255
  2026. end
  2027. end