Repository navigation
Conversation
`appkit db check` checks the committed migrations against config/database/schema.ts without Databricks or Lakebase access, so CI can run it on every pull request. It fails when: - schema.ts changed and no committed migration has the change; - the journal lists a migration generated before the one ahead of it, which a branch that ran the newer one never runs, or an entry whose idx is not its position; - a snapshot does not follow the one before it, which happens when two migrations were generated from one snapshot on parallel git branches; - a migration's .sql or snapshot is not committed, or a .sql is not in the journal. Each finding names its fix. Parallel migrations are fixed by taking the base branch's migrations, then `appkit db clean` and `appkit db migrate`. The schema comparison reuses the diff `appkit db migrate` runs, so check fails exactly when migrate would write a migration, and an ambiguous rename counts as a change instead of prompting. The plugin docs' CI section runs `appkit db check` on every pull request, and the template README names it. Signed-off-by: ditadi <victordperd@gmail.com>
ditadi
force-pushed
the
stack/database-dev-flow/07-apps-init
branch
from
October 20, 2026 12:22
7db9fa1 to
81e2e8f
Compare
ditadi
force-pushed
the
stack/database-dev-flow/08-db-check
branch
from
October 20, 2026 12:22
8ef366e to
0d6a48a
Compare
Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 39421984615 -R databricks/appkit -n appkit-template-0.89.0-pr.fc69bde-stack-database-dev-flow-08-db-check-678 -D appkit-pr-678 \
&& unzip -o "appkit-pr-678/appkit-template-0.89.0-pr.fc69bde-stack-database-dev-flow-08-db-check-678.zip" -d "appkit-pr-678" \
&& databricks apps init --template "appkit-pr-678"The template pins |
This was referenced Oct 20, 2026
This branch has not been deployed
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.
🥞 Stacked PR (generated by Stack)
Use this link to review incremental changes.
Stacked on #675.
Summary
Adds
appkit db check, an offline check of the committed migrations for CI. It reads only the checkout, so a pull request can run it without Databricks or Lakebase credentials. It fails when:config/database/schema.tschanged and no committed migration has the change;.sqlor snapshot is not committed, or a.sqlis not in the journal.Each finding names its fix, and the command exits 1 on any of them.
Details
appkit db migrateruns against the latest snapshot, nowdiffSchemainmigrations.ts. So check fails exactly when migrate would write a migration. An ambiguous rename counts as a change, and nothing prompts.idxis not its position, since drizzle-kit names snapshots byidx.0001_migrationconflict in git first. The check catches a resolution that keeps both. The fix it names takes the base branch's migrations, then runsappkit db cleanandappkit db migrate. The clean is there because the developer's branch already ran the old migration.db checkjoins the commands table. The CI section runs it on every pull request and explains the conflict. The template README names it.Tests
runChecktests generate real migration history with drizzle-kit and a realschema.ts, with every Databricks and Lakebase call throwing. They cover:schema.tschange without its migration, with and without committed migrations, and an ambiguous column rename;whenout of order, and anidxthat is not its position;.sqland snapshot, and an unlisted.sql.