class CreateMerchantUserTables < ActiveRecord::Migration def self.up create_table :merchant_user_relations do |t| #商家id t.column :merchant_id, :integer, :null => false #用户id t.column :user_id, :integer, :null => false #是否生效 t.column :is_effect, :boolean, :default => false #是否是商家超管,只有超管才能去查看结账和退款。 t.column :is_super_admin, :boolean, :default => false #管理商品id串,多个商品用逗号隔开,所有商品用0表示 t.column :manage_product_ids, :text t.timestamps end add_index :merchant_user_relations, :user_id add_index :merchant_user_relations, :merchant_id end def self.down drop_table :merchant_user_relations end end