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.
21 lines
559 B
Python
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")
|