diff --git a/surfsense_backend/alembic/versions/83_add_reddit_follow_incentive_task.py b/surfsense_backend/alembic/versions/83_add_reddit_follow_incentive_task.py new file mode 100644 index 000000000..a9fbb77ae --- /dev/null +++ b/surfsense_backend/alembic/versions/83_add_reddit_follow_incentive_task.py @@ -0,0 +1,35 @@ +"""Add REDDIT_FOLLOW to incentive task type enum + +Revision ID: 83 +Revises: 82 + +Changes: +1. Add REDDIT_FOLLOW value to incentivetasktype enum +""" + +from collections.abc import Sequence + +import sqlalchemy as sa + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "83" +down_revision: str | None = "82" +branch_labels: str | Sequence[str] | None = None +depends_on: str | Sequence[str] | None = None + + +def upgrade() -> None: + """Add REDDIT_FOLLOW to incentivetasktype enum.""" + op.execute("ALTER TYPE incentivetasktype ADD VALUE IF NOT EXISTS 'REDDIT_FOLLOW'") + + +def downgrade() -> None: + """Remove REDDIT_FOLLOW from incentivetasktype enum. + + Note: PostgreSQL doesn't support removing values from enums directly. + This would require recreating the enum type, which is complex and risky. + For safety, we leave the enum value in place during downgrade. + """ + pass diff --git a/surfsense_backend/app/db.py b/surfsense_backend/app/db.py index 8c6942e44..876bc1d3c 100644 --- a/surfsense_backend/app/db.py +++ b/surfsense_backend/app/db.py @@ -163,6 +163,7 @@ class IncentiveTaskType(str, Enum): """ GITHUB_STAR = "GITHUB_STAR" + REDDIT_FOLLOW = "REDDIT_FOLLOW" # Future tasks can be added here: # GITHUB_ISSUE = "GITHUB_ISSUE" # SOCIAL_SHARE = "SOCIAL_SHARE" @@ -178,6 +179,12 @@ INCENTIVE_TASKS_CONFIG = { "pages_reward": 100, "action_url": "https://github.com/MODSetter/SurfSense", }, + IncentiveTaskType.REDDIT_FOLLOW: { + "title": "Join our Subreddit", + "description": "Join the SurfSense community on Reddit", + "pages_reward": 100, + "action_url": "https://www.reddit.com/r/SurfSense/", + }, # Future tasks can be configured here: # IncentiveTaskType.GITHUB_ISSUE: { # "title": "Create an issue",