diff --git a/db/migrate/20160608123748_create_profile_followers_table.rb b/db/migrate/20160608123748_create_profile_followers_table.rb index 7446fee..3ffbb4c 100644 --- a/db/migrate/20160608123748_create_profile_followers_table.rb +++ b/db/migrate/20160608123748_create_profile_followers_table.rb @@ -12,7 +12,7 @@ class CreateProfileFollowersTable < ActiveRecord::Migration t.column :profile_type, :string, :null => false end - add_foreign_key :profiles_circles, :circles, :on_delete => :nullify + add_foreign_key :profiles_circles, :circles, :on_delete => :cascade add_index :profiles_circles, [:profile_id, :circle_id], :name => "profiles_circles_composite_key_index", :unique => true add_index :circles, [:person_id, :name], :name => "circles_composite_key_index", :unique => true diff --git a/db/schema.rb b/db/schema.rb index 8b809e4..5019b82 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -877,5 +877,5 @@ ActiveRecord::Schema.define(version: 20160608123748) do add_index "votes", ["voteable_id", "voteable_type"], name: "fk_voteables", using: :btree add_index "votes", ["voter_id", "voter_type"], name: "fk_voters", using: :btree - add_foreign_key "profiles_circles", "circles", on_delete: :nullify + add_foreign_key "profiles_circles", "circles", on_delete: :cascade end -- libgit2 0.21.2