-- See the definition of the payment-type CHECK constraint
SELECT conname AS constraint_name,
pg_get_constraintdef(oid) AS definition
FROM pg_constraint
WHERE conrelid = 'organizations'::regclass
AND contype = 'c'
AND conname = 'organizations_organization_payment_type_check';
2 Fix current constraint by updating
ALTER TABLE organizations
DROP CONSTRAINT IF EXISTS organizations_organization_payment_type_check;
ALTER TABLE organizations
ADD CONSTRAINT organizations_organization_payment_type_check
CHECK (organization_payment_type IN (
'DIRECT_DEBIT_EIGHT_DAYS',
'DIRECT_DEBIT_THIRTY_DAYS',
'DIRECT_DEBIT_EIGHT_DAYS_TWO_PERC_DISCOUNT',
'DIRECT_DEBIT_EIGHT_DAYS_THREE_PERC_DISCOUNT',
'NOT_DETERMINED',
'PRO_FORMA',
'FOURTEEN_DAYS',
'THIRTY_DAYS',
'THIRTY_DAYS_TWO_PERC_DISCOUNT',
'THIRTY_DAYS_THREE_PERC_DISCOUNT',
'FORTY_FIVE_DAYS',
'SIXTY_DAYS',
'NINETY_DAYS',
'HUNDRED_TWENTY_DAYS'
));