summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-22 18:01:14 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-22 18:01:14 -0600
commita92be45296f8cc3210030602bd83a8d0229206cd (patch)
treea05581fb30ec20105a074af6e6a682823429e269 /db/migrate
parentbf58a3a1b148ed6b1ace157cfaafe34831706721 (diff)
Añade modelo Address
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20230322234003_create_addresses.rb2
-rw-r--r--db/migrate/20230322234849_create_user_account_addresses.rb10
2 files changed, 11 insertions, 1 deletions
diff --git a/db/migrate/20230322234003_create_addresses.rb b/db/migrate/20230322234003_create_addresses.rb
index ff36085..cab3dee 100644
--- a/db/migrate/20230322234003_create_addresses.rb
+++ b/db/migrate/20230322234003_create_addresses.rb
@@ -1,7 +1,7 @@
class CreateAddresses < ActiveRecord::Migration[7.0]
def change
create_table :addresses do |t|
- t.string :number
+ t.integer :number
t.string :street
t.string :zip_code
t.string :country
diff --git a/db/migrate/20230322234849_create_user_account_addresses.rb b/db/migrate/20230322234849_create_user_account_addresses.rb
new file mode 100644
index 0000000..a2e0e9b
--- /dev/null
+++ b/db/migrate/20230322234849_create_user_account_addresses.rb
@@ -0,0 +1,10 @@
+class CreateUserAccountAddresses < ActiveRecord::Migration[7.0]
+ def change
+ create_table :user_account_addresses do |t|
+ t.references :user_account, null: false, foreign_key: true
+ t.references :address, null: false, foreign_key: true
+
+ t.timestamps
+ end
+ end
+end