Skip to content

Commit

Permalink
IRONN-264 remove research_data rows with translated timepoints for co…
Browse files Browse the repository at this point in the history
…rrection on next cache_research_data() run
  • Loading branch information
pbugni committed Nov 26, 2024
1 parent e500d7a commit 3b57217
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions portal/migrations/versions/4f5daa2b48db_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""remove non english rows from report data (IRONN-264)
Revision ID: 4f5daa2b48db
Revises: 967a074a0404
Create Date: 2024-11-25 13:48:01.321510
"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '4f5daa2b48db'
down_revision = '967a074a0404'


def upgrade():
connection = op.get_bind()
connection.execute("DELETE FROM research_data WHERE NOT (data->>'timepoint' ~ '^(Baseline|Month)');")
# next run of `cache_research_data()` will pick up those just deleted.


def downgrade():
# no point in bringing those back
pass

0 comments on commit 3b57217

Please sign in to comment.