20180605064726_create_merchant_user_tables.rb 814 B

1234567891011121314151617181920212223242526
  1. class CreateMerchantUserTables < ActiveRecord::Migration
  2. def self.up
  3. create_table :merchant_user_relations do |t|
  4. #商家id
  5. t.column :merchant_id, :integer, :null => false
  6. #用户id
  7. t.column :user_id, :integer, :null => false
  8. #是否生效
  9. t.column :is_effect, :boolean, :default => false
  10. #是否是商家超管,只有超管才能去查看结账和退款。
  11. t.column :is_super_admin, :boolean, :default => false
  12. #管理商品id串,多个商品用逗号隔开,所有商品用0表示
  13. t.column :manage_product_ids, :text
  14. t.timestamps
  15. end
  16. add_index :merchant_user_relations, :user_id
  17. add_index :merchant_user_relations, :merchant_id
  18. end
  19. def self.down
  20. drop_table :merchant_user_relations
  21. end
  22. end