Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
785 B

class AddDeleteCascade < ActiveRecord::Migration[7.0]
def up
remove_foreign_key :schemes, :organisations, column: "managing_organisation_id"
remove_foreign_key :schemes, :organisations, column: "owning_organisation_id"
add_foreign_key :schemes, :organisations, column: "managing_organisation_id", on_delete: :cascade
add_foreign_key :schemes, :organisations, column: "owning_organisation_id", on_delete: :cascade
end
def down
remove_foreign_key :schemes, :organisations, column: "managing_organisation_id"
remove_foreign_key :schemes, :organisations, column: "owning_organisation_id"
add_foreign_key :schemes, :organisations, column: "managing_organisation_id"
add_foreign_key :schemes, :organisations, column: "owning_organisation_id"
end
end