group_removed_users table to forbid users joining once removed
This commit is contained in:
12
db/migrate/20190716173227_create_group_removed_accounts.rb
Normal file
12
db/migrate/20190716173227_create_group_removed_accounts.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateGroupRemovedAccounts < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :group_removed_accounts do |t|
|
||||
t.belongs_to :group, foreign_key: { on_delete: :cascade }, null: false
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :group_removed_accounts, [:account_id, :group_id], unique: true
|
||||
add_index :group_removed_accounts, [:group_id, :account_id]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user