group_removed_users table to forbid users joining once removed

This commit is contained in:
2458773093
2019-07-16 08:46:03 +03:00
parent c56a8914f3
commit 520c125e21
5 changed files with 51 additions and 6 deletions

View 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