Skip to content

Add the content.isDescription column - #3033

Open
cqnykamp wants to merge 1 commit into
Doenet:mainfrom
cqnykamp:split/is-description-column
Open

cqnykamp wants to merge 1 commit into
Doenet:mainfrom
cqnykamp:split/is-description-column

Conversation

@cqnykamp

@cqnykamp cqnykamp commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Do not let a deploy run this migration. Apply it out-of-band first, mark it applied, then deploy. The full procedure, with the pre-flight results already gathered from prod, is in MANUAL_MIGRATION_PLAN.md.

ALTER TABLE `content` ADD COLUMN `isDescription` BOOLEAN NOT NULL DEFAULT false;

What the column is for

A problem set has no way to include an introduction, a section header, or shared setup text — every child document is a scored, numbered problem.

The viewer already has the concept. SingleDocSource.isDescription marks a document as unscored and unnumbered, and it is already implemented there for question numbering, credit, shuffle anchoring, and the per-item attempt button. There is just no way to set it. This column is where that setting will live.

Nothing reads it yet; the API that uses it is a separate PR. Applying this on its own changes no behavior.

Why it ships on its own

ADD COLUMN on content cannot use instant DDL. The table carries two FULLTEXT indexes (content_name_idx, content_source_idx), which force InnoDB all the way back to ALGORITHM=COPY — a full table rebuild. On dev3 that took 7 minutes 3 seconds, against a 5-minute deploy timeout.

The deploy kills the rebuild partway through. MySQL DDL is not transactional, so the column commits while Prisma's bookkeeping does not, leaving _prisma_migrations with an unfinished row. Every subsequent deploy then fails with P3009 — including a rollback to main — until someone runs prisma migrate resolve by hand. This is not hypothetical; it happened on dev3 on 2026-08-15 at 02:30 UTC.

Prod's content table is larger, so expect longer, with writes blocked for the duration. The underlying timeout problem is tracked in #3027.

Keeping the migration in its own PR means that window gets scheduled and reviewed on its own, and nothing else has to roll back with it.

🤖 Generated with Claude Code

A problem set has no way to include an introduction, a section header, or
shared setup text — every child document is a scored, numbered problem. The
viewer already has the concept: `SingleDocSource.isDescription` marks a
document as unscored and unnumbered. Nothing here can set it.

This adds only the column, with no code reading it, so that the migration
can be applied on its own. That matters more than usual here: `ADD COLUMN`
on `content` cannot use instant DDL — its two FULLTEXT indexes force a full
`ALGORITHM=COPY` rebuild, measured at 7 min 3 s on dev3 against a 5-minute
deploy timeout. The deploy kills it mid-rebuild, and because MySQL DDL is
not transactional the column commits while Prisma's bookkeeping does not,
leaving `_prisma_migrations` unfinished. Every subsequent deploy then fails
with `P3009` — including a rollback — until someone runs
`prisma migrate resolve` by hand. This already happened on dev3
(2026-08-15 02:30 UTC).

`MANUAL_MIGRATION_PLAN.md` is the runbook for applying it to prod by hand,
with the pre-flight results already gathered. Tracked in Doenet#3027.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cqnykamp
cqnykamp force-pushed the split/is-description-column branch from 9dc8d31 to a06130f Compare August 20, 2026 01:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants