-- Drop the rows the narrower constraints are about to forbid, or re-adding -- them fails against existing data (the 0051 down-migration pattern). DELETE FROM recommendation_weight_profiles WHERE profile = 'songs_like'; DELETE FROM recommendation_tuning_audit WHERE scope = 'songs_like'; ALTER TABLE recommendation_tuning_audit DROP CONSTRAINT recommendation_tuning_audit_scope_check; ALTER TABLE recommendation_tuning_audit ADD CONSTRAINT recommendation_tuning_audit_scope_check CHECK (scope IN ('radio', 'daily_mix', 'taste', 'discover')); ALTER TABLE recommendation_weight_profiles DROP CONSTRAINT recommendation_weight_profiles_profile_check; ALTER TABLE recommendation_weight_profiles ADD CONSTRAINT recommendation_weight_profiles_profile_check CHECK (profile IN ('radio', 'daily_mix'));