Skip to content

Commit 70d4764

Browse files
maebealeclaude
andcommitted
Move payment_id reference to refactor migration and update schema
The add_reference for event_registrations.payment_id must be in the branch's refactor migration (not the original payments migration from main) so it gets applied when CI loads schema.rb then runs pending migrations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d7e7279 commit 70d4764

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

db/migrate/20260106225822_add_payments_table.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ def change
2626
add_index :payments, [ :payable_type, :payable_id ]
2727
add_index :payments, [ :payable_type, :payable_id, :status ]
2828

29-
add_reference :event_registrations, :payment, null: true, foreign_key: true
3029
end
3130
end

db/migrate/20260301132706_refactor_payment_associations.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ def change
1414

1515
# stripe_payment_intent_id is no longer required
1616
change_column_null :payments, :stripe_payment_intent_id, true
17+
18+
# EventRegistration belongs_to :payment (singular, direct FK)
19+
add_reference :event_registrations, :payment, null: true, foreign_key: true
1720
end
1821
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@
684684
t.string "failure_message"
685685
t.integer "organization_id"
686686
t.bigint "payer_id", null: false
687-
t.string "payment_type", default: "stripe", null: false
687+
t.string "payment_type", default: "other", null: false
688688
t.string "status", null: false
689689
t.string "stripe_charge_id"
690690
t.json "stripe_metadata"

0 commit comments

Comments
 (0)