Skip to content
Snippets Groups Projects
Commit 304d1a3c authored by ornanovitch's avatar ornanovitch
Browse files

Merge branch '144-deleted-transitions-remain-in-history-database-table' into 'dev'

fix(db): old deleted transition names remain in history table"

Closes #144

See merge request !96
parents 2ef941fa 89a3c470
No related branches found
No related tags found
No related merge requests found
""" update obselete transition names in history
Revision ID: 8652789edda9
Revises: 0147b747696e
Create Date: 2024-10-01 01:18:46.781652
"""
from alembic import op
import sqlalchemy as sa
import hiboo
revision = "8652789edda9"
down_revision = "0147b747696e"
branch_labels = None
depends_on = None
history_table = sa.Table(
"history",
sa.MetaData(),
sa.Column("category", sa.String(length=25), nullable=True),
sa.Column("value", sa.String(), nullable=True),
)
def upgrade():
connection = op.get_bind()
connection.execute(
history_table.update()
.where(
sa.and_(
history_table.c.category == "transition",
sa.or_(
history_table.c.value == "purge-deleted",
history_table.c.value == "purge-blocked",
),
)
)
.values(value="purge")
)
connection.execute(
history_table.update()
.where(
sa.and_(
history_table.c.category == "transition",
history_table.c.value == "delete-blocked",
)
)
.values(value="delete")
)
def downgrade():
"""I don't think there will be a return journey"""
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment