pdf-quiz-generator/backend/alembic/versions/g4b7e2f5a903_share_tokens.py
Daniel 0fa8d0a689 feat: shareable quiz links, moderated comments and AI authoring
Quiz share links replace the PIN copy with a public /share/{token} landing page; owners can enable/revoke without showing the full link. Moderated article/question comments with approval flow, bounds and rate limits. Educator AI article drafts/refine and private card generation with Celery job polling. Migrations f2a1c9d4e801 and g4b7e2f5a903. 50 backend and 85 frontend tests pass.
2026-09-07 17:10:08 +02:00

21 lines
559 B
Python

"""Public quiz share tokens.
Revision ID: g4b7e2f5a903
Revises: f2a1c9d4e801
"""
from alembic import op
revision = "g4b7e2f5a903"
down_revision = "f2a1c9d4e801"
branch_labels = None
depends_on = None
def upgrade():
op.execute("ALTER TABLE quizzes ADD COLUMN IF NOT EXISTS share_token VARCHAR(64)")
op.execute("CREATE UNIQUE INDEX IF NOT EXISTS uq_quizzes_share_token ON quizzes (share_token)")
def downgrade():
op.execute("DROP INDEX IF EXISTS uq_quizzes_share_token")
op.execute("ALTER TABLE quizzes DROP COLUMN IF EXISTS share_token")