20201124114698_create_bind_users.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # encoding:utf-8
  2. class CreateBindUsers < ActiveRecord::Migration
  3. def up
  4. #用户绑定记录
  5. create_table :bind_users do |t|
  6. #用户ID
  7. t.column :wx_uid, :integer, :null=>false
  8. #老用户编号
  9. t.column :user_no, :string
  10. #昵称
  11. t.column :nickname,:string
  12. #备注
  13. t.column :remark,:string
  14. t.timestamps
  15. end
  16. #系统会员表
  17. create_table :sys_users do |t|
  18. #邀请人ID
  19. t.column :invite_id, :integer, :null=>false
  20. #会员编号
  21. t.column :user_no, :string, :limit=>128
  22. #邀请人编号
  23. t.column :invite_no,:string, :limit=>128
  24. #等级
  25. t.column :dengji,:string, :limit=>128
  26. #群主标记
  27. t.column :show_invite_mode, :boolean, :default=>0
  28. #群主
  29. t.column :rank, :integer, :null=>false
  30. t.timestamps
  31. end
  32. add_index :bind_users, :wx_uid
  33. add_index :sys_users, :invite_id
  34. add_column :wx_users, :user_no,:string,:limit => 128
  35. end
  36. def down
  37. drop_table :bind_users
  38. drop_table :sys_users
  39. remove_column :wx_users, :user_no
  40. end
  41. end