diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20230322234003_create_addresses.rb | 2 | ||||
-rw-r--r-- | db/migrate/20230322234849_create_user_account_addresses.rb | 10 |
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 |