Files
notifications-api/migrations/versions/0284_0283_retry.py

45 lines
830 B
Python
Raw Normal View History

"""empty message
Revision ID: 0284_0283_retry
Revises: 0283_platform_admin_not_live
Create Date: 2016-10-25 17:37:27.660723
"""
# revision identifiers, used by Alembic.
2023-08-29 14:54:30 -07:00
revision = "0284_0283_retry"
down_revision = "0283_platform_admin_not_live"
import sqlalchemy as sa
from alembic import op
def upgrade():
2023-08-29 14:54:30 -07:00
op.execute(
"""
UPDATE
services
SET
count_as_live = not users.platform_admin
FROM
users, services_history
WHERE
services_history.id = services.id and
services_history.version = 1 and
services_history.created_by_id = users.id
;
2023-08-29 14:54:30 -07:00
"""
)
def downgrade():
2023-08-29 14:54:30 -07:00
op.execute(
"""
UPDATE
services
SET
count_as_live = true
;
2023-08-29 14:54:30 -07:00
"""
)