mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
add foreign key to conferences
This commit is contained in:
parent
cce3ff7aea
commit
949f5cb591
1 changed files with 3 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ class MoveConferencesToOrganizations < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def change
|
||||
add_reference :conferences, :organization, index: true, foreign_key: true
|
||||
add_reference :conferences, :organization, index: true
|
||||
|
||||
TempConference.reset_column_information
|
||||
if TempConference.count != 0
|
||||
|
|
@ -18,5 +18,7 @@ class MoveConferencesToOrganizations < ActiveRecord::Migration
|
|||
conference.save!
|
||||
end
|
||||
end
|
||||
|
||||
add_foreign_key :conferences, :organizations, null: false, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue