mbM
Convex Community11mo ago
6 replies
mb

Moving Migrations to their Own Files

Hi folks,

I’m working on adding Migrations using the Stateful Migrations Component and have got everything working. I got a note in code review from @Eva that it’d be good if we could split up our migrations into their own individual files, but when I attempted to do that, I started getting Convex errors.

Is there a supported way to use the migrations component and also have each migration live in its own typescript file (e.g. /convex/migrations/setQuestsUpdatedTimestamp.ts)?
GitHub
Convex Migrations Component for tracking and running stateful migrations - get-convex/migrations
GitHub - get-convex/migrations: Convex Migrations Component for tra...
GitHub
What changed?

Created a setQuestsUpdatedTimestamp migration that sets the updatedAt to now for all quests where it was undefined.

Before:

During:

After:

Progress on #393.
Why?
So that we can ...
chore: Create Migration for Quests.updatedAt in preparation for mak...
Was this page helpful?