From e05709905db8834148c434d493344cc6f213a54b Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 4 Apr 2023 20:53:34 -0600 Subject: Arregladas migraciones de usuarios y direcciones --- db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb') diff --git a/db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb b/db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb index 7732728..e1d3062 100644 --- a/db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb +++ b/db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb @@ -1,7 +1,11 @@ class AddIndexSpanningUsersAndAddresses < ActiveRecord::Migration[7.0] def change + remove_foreign_key(:user_account_addresses, :user_accounts) + remove_foreign_key(:user_account_addresses, :addresses) remove_index(:user_account_addresses, :user_account_id) remove_index(:user_account_addresses, :address_id) + add_foreign_key(:user_account_addresses, :user_accounts) + add_foreign_key(:user_account_addresses, :addresses) add_index(:user_account_addresses, :user_account_id) add_index(:user_account_addresses, :address_id) add_index(:user_account_addresses, [:address_id, :user_account_id], unique: true) -- cgit v1.2.3