Add on_delete cascade attr to user-tournament fk
This commit is contained in:
parent
d89c24a645
commit
244da7a2e6
|
|
@ -46,7 +46,7 @@ class CreateSchema < ActiveRecord::Migration[5.2]
|
||||||
t.boolean :public, default: true
|
t.boolean :public, default: true
|
||||||
|
|
||||||
# relation to owner
|
# relation to owner
|
||||||
t.belongs_to :user, index: true, foreign_key: true, null: false
|
t.belongs_to :user, index: true, null: false, foreign_key: { on_delete: cascade }
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue