Files
notifications-api/migrations/versions/0297_template_redacted_fix.py

27 lines
633 B
Python
Raw Normal View History

"""
2019-06-25 17:08:18 +01:00
Revision ID: 0297_template_redacted_fix
Revises: 0296_agreement_signed_by_person
Create Date: 2019-06-25 17:02:14.350064
"""
2024-04-01 15:12:33 -07:00
from alembic import op
2023-08-29 14:54:30 -07:00
revision = "0297_template_redacted_fix"
down_revision = "0296_agreement_signed_by_person"
def upgrade():
2026-01-27 07:33:54 -08:00
op.execute("""
INSERT INTO template_redacted (template_id, redact_personalisation, updated_at, updated_by_id)
SELECT templates.id, FALSE, now(), templates.created_by_id
FROM templates
WHERE templates.id NOT IN (SELECT template_id FROM template_redacted WHERE template_id = templates.id)
;
2026-01-27 07:33:54 -08:00
""")
def downgrade():
pass