mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-17 02:32:32 -05:00
Fix downgrade to work if any notifications have status = 'created'
This commit is contained in:
@@ -39,6 +39,7 @@ def downgrade():
|
||||
name='notify_status_types')
|
||||
status_type.create(op.get_bind())
|
||||
op.add_column('notifications', sa.Column('old_status', status_type, nullable=True))
|
||||
op.execute("update notifications set status = 'sending' where status = 'created'")
|
||||
op.execute('update notifications set old_status = CAST(CAST(status as text) as notify_status_types)')
|
||||
op.alter_column('notifications', 'status', new_column_name='new_status')
|
||||
op.alter_column('notifications', 'old_status', new_column_name='status')
|
||||
|
||||
Reference in New Issue
Block a user