fix(migrations): keep every payment method type in use

Production allows edc and delivery payment methods through a
payment_methods_type_check changed outside the migrations, and has rows of
both. 000094 rewrote the constraint with only cash, card, digital_wallet and
point, so it failed on production (in its transaction, leaving the database
dirty at 94 with nothing applied).

000094 now keeps edc and delivery, down included, and also allows qr, which
the code accepts but no constraint did. 000098 sets the same list where the
old 000094 already ran, as on staging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
efrilm
2026-09-30 23:00:14 +07:00
co-authored by Claude Opus 5.5
parent e94eb2c26d
commit c9654a387a
4 changed files with 13 additions and 3 deletions
@@ -0,0 +1,7 @@
-- Production also has edc and delivery payment methods, allowed by a constraint changed
-- outside the migrations, and the code also accepts qr, which no constraint allowed.
-- 000094 first rewrote the constraint without them, which
-- failed on production and, where it ran, dropped them. Keep every type in use.
ALTER TABLE payment_methods DROP CONSTRAINT IF EXISTS payment_methods_type_check;
ALTER TABLE payment_methods ADD CONSTRAINT payment_methods_type_check
CHECK (type IN ('cash', 'card', 'digital_wallet', 'qr', 'edc', 'delivery', 'point'));