mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Add new virus scan statuses
Added the following new notification statuses: * pending_virus_check * virus_scan_failed If we decide to remove these statuses in future, we will need to replace them with a different status in the notifications and Notification_history tables where they are referenced, so pending-virus-check will be replaced with sending, and virus-scan-failed will be replaced with permanent-failure.
This commit is contained in:
27
migrations/versions/0177_add_virus_scan_statuses.py
Normal file
27
migrations/versions/0177_add_virus_scan_statuses.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0177_add_virus_scan_statuses
|
||||
Revises: 0176_alter_billing_columns
|
||||
Create Date: 2018-02-21 14:05:04.448977
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
|
||||
revision = '0176_alter_billing_columns'
|
||||
down_revision = '0175_drop_job_statistics_table'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("INSERT INTO notification_status_types (name) VALUES ('pending-virus-check')")
|
||||
op.execute("INSERT INTO notification_status_types (name) VALUES ('virus-scan-failed')")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute("UPDATE notifications SET notification_status = 'created' WHERE notification_status = 'pending-virus-check'")
|
||||
op.execute("UPDATE notification_history SET notification_status = 'created' WHERE notification_status = 'pending-virus-check'")
|
||||
|
||||
op.execute("UPDATE notifications SET notification_status = 'permanent-failure' WHERE notification_status = 'virus-scan-failed'")
|
||||
op.execute("UPDATE notification_history SET notification_status = 'permanent-failure' WHERE notification_status = 'virus-scan-failed'")
|
||||
|
||||
op.execute("DELETE FROM notification_status_types WHERE name in ('pending-virus-check', 'virus-scan-failed')")
|
||||
Reference in New Issue
Block a user