summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20230414000904_drop_foreign_key_payment_in_order.rb6
-rw-r--r--db/schema.rb5
2 files changed, 8 insertions, 3 deletions
diff --git a/db/migrate/20230414000904_drop_foreign_key_payment_in_order.rb b/db/migrate/20230414000904_drop_foreign_key_payment_in_order.rb
new file mode 100644
index 0000000..bf95bed
--- /dev/null
+++ b/db/migrate/20230414000904_drop_foreign_key_payment_in_order.rb
@@ -0,0 +1,6 @@
+class DropForeignKeyPaymentInOrder < ActiveRecord::Migration[7.0]
+ def change
+ remove_foreign_key(:orders, column: :payment_id)
+ change_column_null(:orders, :payment_id, true)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 4564cc7..5bb24ca 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2023_04_12_020105) do
+ActiveRecord::Schema[7.0].define(version: 2023_04_14_000904) do
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -81,7 +81,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_12_020105) do
t.string "public_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.bigint "payment_id", null: false
+ t.bigint "payment_id"
t.index ["payment_id"], name: "index_orders_on_payment_id"
t.index ["user_account_id"], name: "index_orders_on_user_account_id"
end
@@ -169,7 +169,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_12_020105) do
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "cards", "user_accounts"
add_foreign_key "carts", "user_accounts"
- add_foreign_key "orders", "payments"
add_foreign_key "orders", "user_accounts"
add_foreign_key "payments", "cards"
add_foreign_key "payments", "orders"