more files

This commit is contained in:
Kenneth Kehl
2023-07-17 11:29:08 -07:00
parent 56ea2464e4
commit cefb8a281f
11 changed files with 158 additions and 71 deletions

View File

@@ -7,6 +7,8 @@ Create Date: 2017-01-17 15:00:00.000000
"""
# revision identifiers, used by Alembic.
from sqlalchemy import text
revision = '0159_add_historical_redact'
down_revision = '0158_remove_rate_limit_default'
@@ -15,8 +17,13 @@ import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from flask import current_app
def upgrade():
op.execute(
conn = op.get_bind()
input_params = {
"notify_user": current_app.config['NOTIFY_USER_ID']
}
conn.execute(text(
"""
INSERT INTO template_redacted
(
@@ -29,12 +36,12 @@ def upgrade():
templates.id,
false,
now(),
'{notify_user}'
:notify_user
FROM
templates
LEFT JOIN template_redacted on template_redacted.template_id = templates.id
WHERE template_redacted.template_id IS NULL
""".format(notify_user=current_app.config['NOTIFY_USER_ID'])
"""), input_params
)