mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-04 19:15:30 +00:00
fix: Provide an Alembic update script to fixe quotes
This commit is contained in:
parent
9e999e7202
commit
06ffee18a0
@ -0,0 +1,47 @@
|
||||
"""update history detail quotes
|
||||
|
||||
Revision ID: fbc7cf864b24
|
||||
Revises: 0967658d9c0d
|
||||
Create Date: 2022-05-04 19:49:54.054285
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'fbc7cf864b24'
|
||||
down_revision = '0967658d9c0d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
history_table = sa.sql.table(
|
||||
'history',
|
||||
sa.Column('id', sa.Integer),
|
||||
sa.Column('msg', sa.String),
|
||||
sa.Column('detail', sa.Text),
|
||||
sa.Column('created_by', sa.String),
|
||||
sa.Column('created_on', sa.DateTime),
|
||||
sa.Column('domain_id', sa.Integer)
|
||||
)
|
||||
|
||||
op.execute(
|
||||
history_table.update().where(
|
||||
sa.and_(
|
||||
history_table.c.detail.like("%'%"),
|
||||
history_table.c.detail.notlike("%rrests%"),
|
||||
history_table.c.detail.notlike("%rrsets%")
|
||||
)
|
||||
).values({
|
||||
'detail': sa.func.replace(
|
||||
history_table.c.detail,
|
||||
"'",
|
||||
'"'
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
Loading…
Reference in New Issue
Block a user