DOCS / GETTING STARTED
Pulling kit updates
A project built on LaunchCrate takes kit updates with a git merge from the
repository you were invited to, and their migrations run at the next
start next to yours. The two sets of migrations never clash: the kit's are
numbered 0001 to 0999, and just migration names yours by date and
time.
Add the kit as a remote, once
git remote add launchcrate git@github.com:launchcrate/launchcrate.gitPull an update
git fetch launchcrate
git diff HEAD...launchcrate/main --stat -- api/migrations # what's coming
git merge launchcrate/main
just migrate-run # the API also applies them at startup
just checkGenerated files are easier to regenerate than to merge: on a conflict in
api/openapi.json or web/src/lib/api-types.gen.ts, take either side and
run just gen-api; for api/.sqlx/, run just prepare. Commit the
merge, then deploy as usual (Deploying).
Why the migrations don't clash
sqlx records each applied migration by its number, with a checksum of
the file. Two files with the same number would stop the API at startup
with migration 45 was previously applied but has been modified, which
is why the numbers are split:
| Files | Whose | Created by |
|---|---|---|
0001_users.sql … 0999_… |
The kit's | Kit releases |
20261120143000_widgets.sql |
Yours | just migration, just new-module |
A date-and-time number is always larger than a 4-digit one, and sqlx applies every migration it hasn't recorded yet, not only those above the last one it applied. So: