`Question.is_shared` defaulted to 1 and was only ever set by a route nothing called, so in practice it divided the bank into "everything" and "everything, plus your own private ones" — a distinction that cost every recommendation denominator a join and never changed an answer. Who may reach the bank is the site's own access rules; who may manage a question is the category grant tree. So the two predicates the whole bank was built on are now the same thing, and say what they actually mean: a question is out of reach if it has been deleted or belongs to a course. Nothing else. The column is dropped, the route that set it is gone, the bulk "share" action with it, and the Private tile and pill go from the question manager. The tests that turned on it have been rewritten rather than deleted, because the rule they were really about survives: revoking a question still revokes every session carrying it — by deleting it, which is the only revocation left. Several others named a category holding exactly two reachable questions and then answered two particular ids; that category holds four now, so they name the pair instead. A session's own sharing flag is untouched — that is a different thing, and it is still how a session is handed to somebody. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
29 lines
926 B
Python
29 lines
926 B
Python
"""Drop questions.is_shared.
|
|
|
|
Per-question sharing is gone. The column defaulted to 1 and was only ever set
|
|
by a route nothing called, so in practice it divided the bank into "everything"
|
|
and "everything, plus your own private ones" — a distinction that cost every
|
|
recommendation denominator a join and never changed an answer. Who may see the
|
|
bank is decided by the site's own access rules, and who may *manage* a question
|
|
by the category grant tree.
|
|
|
|
Revision ID: b4c5d6e7f809
|
|
Revises: a3b4c5d6e7f8
|
|
"""
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "b4c5d6e7f809"
|
|
down_revision = "a3b4c5d6e7f8"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.drop_column("questions", "is_shared")
|
|
|
|
|
|
def downgrade():
|
|
# Back as it was: visible by default, which is what every row held.
|
|
op.add_column("questions",
|
|
sa.Column("is_shared", sa.Integer(), nullable=True, server_default="1"))
|