Files
apskel-pos-backend/migrations/000098_allow_edc_delivery_payment_methods.up.sql
T

8 lines
557 B
SQL
Raw Normal View History

-- 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'));