Add 0.7dev→0.7 DoenetML version migration script - #3018
Open
dqnykamp wants to merge 2 commits into
Open
Conversation
One-off migration to move a single user's content off the `0.7dev` DoenetML version onto the released `0.7` version. Requires the owner's username as a CLI argument and supports --dry-run. Uses Prisma (not raw SQL) and resolves both versions by their `displayedVersion` string rather than hard-coded ids, so it can be run safely against production without risking a typo in a manual UPDATE. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
I can't review this until #3010 is merged or until you turn CI back to normal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a one-off maintenance script,
apps/api/scripts/convert_doenetml_0.7dev_to_0.7.ts, to move a single user's content off the0.7devDoenetML version and onto the released0.7version.usernameas a CLI argument.0.7dev) and target (0.7) versions by theirdisplayedVersionstring instead of hard-coded ids — so it can run safely against production without risking a typo in a manualUPDATE.--dry-run(mirrors the siblingdelete_empty_sessions.tsscript), which reports the affected row count without writing. Run this first against prod.Usage
(or
npx tsx scripts/convert_doenetml_0.7dev_to_0.7.ts <username>in local dev)Notes
contenttable only, matching the original request.contentRevisionsalso carries adoenetmlVersionId; if saved revision snapshots should move too, that can be added.🤖 Generated with Claude Code