Fix issue where we didn't delete robots immediately under a namespace

This could result in "hanging" robot accounts, although that would only leak the names of said accounts. Now we delete them immediately AND we proactively delete them before replacing the namespace (just to be sure)
This commit is contained in:
Joseph Schorr 2018-05-09 14:52:28 +03:00
parent bd1f3e6bb8
commit f06eec8a35
5 changed files with 132 additions and 10 deletions

View file

@ -0,0 +1,23 @@
"""Cleanup old robots
Revision ID: 5b7503aada1b
Revises: 224ce4c72c2f
Create Date: 2018-05-09 17:18:52.230504
"""
# revision identifiers, used by Alembic.
revision = '5b7503aada1b'
down_revision = '224ce4c72c2f'
from alembic import op
import sqlalchemy as sa
from util.migrate.cleanup_old_robots import cleanup_old_robots
def upgrade(tables):
cleanup_old_robots()
def downgrade(tables):
# Nothing to do.
pass