mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 05:42:39 +02:00
feat(backend): add new incentive task type for Reddit follow
Introduce a new incentive task type, REDDIT_FOLLOW, to encourage users to join the SurfSense community on Reddit. This includes a title, description, pages reward, and action URL for the task.
This commit is contained in:
parent
0b65c3a98c
commit
16b839138d
2 changed files with 42 additions and 0 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue