Skip to content

Add 0.7dev→0.7 DoenetML version migration script - #3018

Open
dqnykamp wants to merge 2 commits into
Doenet:mainfrom
dqnykamp:convert-doenetml-0.7dev-to-0.7
Open

Add 0.7dev→0.7 DoenetML version migration script#3018
dqnykamp wants to merge 2 commits into
Doenet:mainfrom
dqnykamp:convert-doenetml-0.7dev-to-0.7

Conversation

@dqnykamp

Copy link
Copy Markdown
Member

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 the 0.7dev DoenetML version and onto the released 0.7 version.

  • Requires the owner's username as a CLI argument.
  • Uses Prisma rather than raw SQL, and resolves both the source (0.7dev) and target (0.7) versions by their displayedVersion string instead of hard-coded ids — so it can run safely against production without risking a typo in a manual UPDATE.
  • Supports --dry-run (mirrors the sibling delete_empty_sessions.ts script), which reports the affected row count without writing. Run this first against prod.

Usage

# dry run first
node dist/scripts/convert_doenetml_0.7dev_to_0.7.js <username> --dry-run
# then for real
node dist/scripts/convert_doenetml_0.7dev_to_0.7.js <username>

(or npx tsx scripts/convert_doenetml_0.7dev_to_0.7.ts <username> in local dev)

Notes

  • Scoped to the content table only, matching the original request. contentRevisions also carries a doenetmlVersionId; if saved revision snapshots should move too, that can be added.

🤖 Generated with Claude Code

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>
@dqnykamp
dqnykamp requested a review from cqnykamp July 23, 2026 17:09
@cqnykamp

Copy link
Copy Markdown
Contributor

I can't review this until #3010 is merged or until you turn CI back to normal.

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