mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
remove any broadcast templates in downgrade step
This commit is contained in:
@@ -85,6 +85,11 @@ def upgrade():
|
|||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
|
op.execute("DELETE FROM template_folder_map WHERE template_id IN (SELECT id FROM templates WHERE template_type = 'broadcast')")
|
||||||
|
op.execute("DELETE FROM template_redacted WHERE template_id IN (SELECT id FROM templates WHERE template_type = 'broadcast')")
|
||||||
|
op.execute("DELETE FROM templates WHERE template_type = 'broadcast'")
|
||||||
|
op.execute("DELETE FROM templates_history WHERE template_type = 'broadcast'")
|
||||||
|
|
||||||
op.execute(f'ALTER TYPE {name} RENAME TO {tmp_name}')
|
op.execute(f'ALTER TYPE {name} RENAME TO {tmp_name}')
|
||||||
old_type.create(op.get_bind())
|
old_type.create(op.get_bind())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user