The referral_commissions migration FK-referenced 'orders' and 'invoices'
tables, but neither is ever created by any migration in the codebase.
MariaDB silently accepted the FKs (checks disabled during migration),
Postgres rejects strictly.
Changed both columns to plain nullable unsignedBigInteger — same column
shape, no FK constraint. Data still references orders/invoices by id
via application logic. Proper FKs can be added in a follow-up migration
once orders/invoices migrations land.
Co-Authored-By: Virgil <virgil@lethean.io>
webhook_events referenced orders and subscriptions tables that don't
exist yet (billing module). Switched to plain unsignedBigInteger columns
with indexes — FKs can be added when the billing tables are created.
Co-Authored-By: Virgil <virgil@lethean.io>
- Remove FK constraint to invoice_items table (not yet created)
- Shorten index names to avoid MariaDB 64-char limit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Credit notes can exist independently of orders. Foreign keys will be
added when orders and refunds modules are implemented.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>