Files
membership-be/fix_enum.sql
2025-12-07 16:59:04 +07:00

12 lines
367 B
SQL

-- Add pending_approval to the userstatus enum if it doesn't exist
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_enum
WHERE enumlabel = 'pending_approval'
AND enumtypid = (SELECT oid FROM pg_type WHERE typname = 'userstatus')
) THEN
ALTER TYPE userstatus ADD VALUE 'pending_approval' BEFORE 'pre_approved';
END IF;
END$$;