summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-04 20:45:40 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-04 20:45:40 -0600
commit7dd7989bba156dc2e790ff6daa9df31cfa0ed7cd (patch)
treeceeef9c344d5cd45a497fc97e0b9cb1a7a8e2b20 /db/migrate
parent96ce018912ceffb7270b883a8982b1e2403cda1c (diff)
Arregladas migraciones de tabla Carts
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20230405013826_create_carts.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/db/migrate/20230405013826_create_carts.rb b/db/migrate/20230405013826_create_carts.rb
index 8975e61..f66e030 100644
--- a/db/migrate/20230405013826_create_carts.rb
+++ b/db/migrate/20230405013826_create_carts.rb
@@ -1,9 +1,10 @@
class CreateCarts < ActiveRecord::Migration[7.0]
def change
create_table :carts do |t|
- t.belongs_to :user_account, null: false, index: { unique: true }, foreign_key: true
-
t.timestamps
end
+
+ add_reference :user_accounts, :cart, foreign_key: true
+ add_reference :carts, :user_account, foreign_key: true
end
end