Skip to content

Conversation

@marcospri
Copy link
Contributor

@marcospri marcospri commented Apr 15, 2025

This column will support the existing feature stored in AnnotationModeration and new features based on the new statuses.

Migration over: #9475

This column will support the existing feature stored in AnnotationModeration and new features based on the new statuses.
Comment on lines +17 to +21
class ModerationStatus(Enum):
APPROVED = "APPROVED"
PENDING = "PENDING"
DENIED = "DENIED"
SPAM = "SPAM"
Copy link
Contributor

Choose a reason for hiding this comment

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

I posted a comment on the POC about whether we want to use strings in the DB here or just ints?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This type of enum is stored in the DB as an integer. I reckon this is the right way way to do "translate strings to integers" when you do not care about the actual integer value.

If we wanted to just rename a value we might not bother on the DB or we could alter the type:

ALTER TYPE name RENAME value deniedtorejected;

that would just change the type and no rows would need to be updated.

Base automatically changed from moderation-status-migration to main April 23, 2025 08:19
@marcospri marcospri merged commit a55b3af into main Apr 23, 2025
9 checks passed
@marcospri marcospri deleted the moderation-status-model branch April 23, 2025 09:07
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