diff --git a/db/migrate/20170531094819_move_conferences_to_organizations.rb b/db/migrate/20170531094819_move_conferences_to_organizations.rb index 12bc7580..e70acf16 100644 --- a/db/migrate/20170531094819_move_conferences_to_organizations.rb +++ b/db/migrate/20170531094819_move_conferences_to_organizations.rb @@ -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