Skip to content

Conversation

@marcospri
Copy link
Contributor

@marcospri marcospri commented Apr 15, 2025

Testing

  • Flag and hide an annotation in main
  • Switch to this branch and run the migration:
PYTHONPATH=. tox -e dev --run-command 'alembic upgrade head'
dev run-test-pre: PYTHONHASHSEED='1927699192'
dev run-test-pre: commands[0] | pip-sync-faster requirements/dev.txt --pip-args --disable-pip-version-check
dev run-test: commands[0] | alembic upgrade head
2025-04-15 15:15:52 1837985 alembic.runtime.migration [INFO] Context impl PostgresqlImpl.
2025-04-15 15:15:52 1837985 alembic.runtime.migration [INFO] Will assume transactional DDL.
2025-04-15 15:15:52 1837985 alembic.runtime.migration [INFO] Running upgrade 2aacaede8542 -> 077e087027b1, Backfill moderation_status based on AnnotationModeration.
        Updated annotation rows as DENIED: 1

SET moderation_status = 'DENIED'
FROM annotation_moderation
WHERE annotation.id = annotation_moderation.annotation_id
AND annotation.moderation_status is null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't override anything if we already have set a status.

@marcospri marcospri requested a review from seanh April 15, 2025 13:18
@marcospri marcospri force-pushed the moderation-writes branch 4 times, most recently from fbe18fc to b7e4bb7 Compare April 23, 2025 14:02
Base automatically changed from moderation-writes to main April 23, 2025 14:14
@marcospri marcospri force-pushed the moderation-backfill branch from 31f7046 to 4f9688a Compare April 23, 2025 14:41
@marcospri marcospri merged commit 0391d9d into main Apr 23, 2025
11 checks passed
@marcospri marcospri deleted the moderation-backfill branch April 23, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants