20201017114641_create_shop_applications.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # encoding:utf-8
  2. class CreateShopApplications < ActiveRecord::Migration
  3. def up
  4. #创建店长申请表
  5. create_table :shop_applications do |t|
  6. # 会员ID
  7. t.column :user_id, :integer, :limit => 8, :default => 0
  8. # 微信ID
  9. t.column :wx_user_id, :integer, :limit => 8, :default => 0
  10. # 昵称
  11. t.column :nickname, :string,:limit => 255
  12. # 姓名
  13. t.column :name, :string,:limit => 255
  14. # 手机号码
  15. t.column :mobile, :integer, :limit => 8, :default => 0
  16. # 总金额
  17. t.column :total, :integer, :limit => 11, :default => 0
  18. # 详细地址
  19. t.column :address, :string,:limit => 255
  20. # 备注
  21. t.column :remark, :string,:limit => 255
  22. # 图片
  23. t.column :image, :string,:limit => 255
  24. # 状态
  25. t.column :status, :boolean, :default=>1
  26. # 审核时间
  27. t.column :pass_time, :datetime
  28. t.timestamps
  29. end
  30. add_column :wx_users, :rank, :integer,:default => 0,:limit => 8
  31. end
  32. def down
  33. remove_column :wx_users, :rank
  34. drop_table :shop_applications
  35. end
  36. end