Merge pull request #850 from GSA/API-847_Clobbering_bad_enum_data

[Bug] API-847 - Making the enum migration more smooth.
This commit is contained in:
Carlo Costino
2024-03-12 16:42:55 -04:00
committed by GitHub

View File

@@ -468,6 +468,19 @@ def upgrade():
existing_nullable=False,
postgresql_using=enum_using("notification_type", NotificationType),
)
# Clobbering bad data here. These are values we don't use any more, and anything with them is unnecessary.
op.execute("""
delete from
service_permissions
where
permission in (
'letter',
'letters_as_pdf',
'upload_letters',
'international_letters',
'broadcast'
);
""")
op.alter_column(
"service_permissions",
"permission",