summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 20:53:34 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 20:53:34 -0600
commite05709905db8834148c434d493344cc6f213a54b (patch)
tree2a84a74cad226f4c359fe77f25d22ec0aa7cbfa0 /db/migrate
parentd520e6d9717d8a64e870930d08218eb30d803690 (diff)
Arregladas migraciones de usuarios y direcciones
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20230325021349_add_unique_indexes_to_user_account_addresses.rb8
-rw-r--r--db/migrate/20230325024534_add_index_spanning_users_and_addresses.rb4
2 files changed, 4 insertions, 8 deletions
diff --git a/db/migrate/20230325021349_add_unique_indexes_to_user_account_addresses.rb b/db/migrate/20230325021349_add_unique_indexes_to_user_account_addresses.rb
deleted file mode 100644
index d8f4d26..0000000
--- a/db/migrate/20230325021349_add_unique_indexes_to_user_account_addresses.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-class AddUniqueIndexesToUserAccountAddresses < ActiveRecord::Migration[7.0]
- def change
- remove_index(:user_account_addresses, :user_account_id)
- remove_index(:user_account_addresses, :address_id)
- add_index(:user_account_addresses, :user_account_id, unique: true)
- add_index(:user_account_addresses, :address_id, unique: true)
- end
-end
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)