A Git worktree keeps one coding agent’s files separate from another’s. It does not stop those agents from applying incompatible migrations to the same development database. Databricks’ new Lakebase implementation guide addresses that problem by giving each agent an isolated database branch, then creating a separate temporary branch when its work reaches a pull request.
The October 8 guide connects Git worktrees, a post-checkout hook, Claude Code, Lakebase and GitHub Actions into an end-to-end development workflow. It follows the change through migrations, tests, a preview application, a schema-diff comment and eventual database-branch deletion.
Databricks had already described Lakebase branching in its database-development guidance. This guide introduces no new branching feature; it connects agent-local experimentation to a reviewable CI process.
Database branches remain disposable test environments. They are not merged into production like Git branches. The code and migration files carry the change forward.
A Worktree Separates Code; a Lakebase Branch Separates State
The local workflow begins with an agent starting Claude Code in a named Git worktree. Each worktree provides a separate directory with its own checked-out branch, allowing agents to edit different features without competing over the same files. A Git post-checkout hook then creates a corresponding Lakebase database branch, so setting up the agent’s code environment also provisions its database environment.
An agent may add a column, modify an index, insert test records or run a migration. Separate directories offer no protection if every session still points at one shared database.
Databricks says Lakebase’s copy-on-write architecture creates branches in under a second, regardless of database size. That is a vendor performance claim, not an independently measured result presented with the guide. The underlying mechanism is documented: a child initially shares its parent’s storage, with changed data written separately.
According to the Lakebase branch documentation, a branch inherits schema and data, but subsequent changes are independent. Child changes do not affect the parent, and parent changes do not automatically appear in children. Isolation also extends to Postgres roles, databases and permission changes.
Teams need to check that the agent’s application, migration tool and tests actually use its assigned branch. Provisioning an isolated database achieves little if a process retains a shared development connection string. Branch-specific connection configuration should be part of worktree setup.
The Pull Request Gets a Fresh Database, Not the Agent’s Sandbox
Once the agent opens a pull request, GitHub Actions creates another temporary Lakebase branch specifically for that PR, separating local experimentation from CI validation.
In Databricks’ example, the PR database is a child of the production branch. It provides a fresh target for evaluating the proposed code and migrations against existing schema and data, without relying on whatever state the agent left behind during development.
The proposed sequence is:
- Open a PR against
main. CI associates the proposed change with a temporary database branch, such aspr-123. - Create the Lakebase branch. The workflow uses the Lakebase CLI to provision the PR’s database environment.
- Apply the checked-in migrations. The example uses Drizzle; the same pattern can use another migration tool.
- Run tests against the isolated database. The PR can exercise database-dependent behavior without altering its parent.
- Deploy a preview application. The application receives the temporary branch’s connection string.
- Post a schema diff. Reviewers see the resulting table, column and index changes alongside the code.
- Delete the branch after merge or closure. The database environment is temporary infrastructure, not a lasting development database.
The example deploys its preview through Databricks Apps. The guide says the approach also applies to other hosting platforms, including Vercel, Netlify and Cloudflare. Whichever service hosts the preview, it must connect to the correct PR branch.
A fresh CI branch can help detect an incomplete migration. An agent might manually alter its local database until the application works, yet fail to capture every alteration in migration files. Rebuilding the proposed state from those files on a fresh branch tests whether the submitted change is reproducible.
The guide points to an example in Databricks’ technical marketing repository, which lists a Lakebase-Agentic-CI directory. The repository describes its contents as training and demo material and disclaims support and suitability guarantees. Teams should review and adapt it as a starting point, not treat it as an established production deployment standard.
Merge the Migration Files, Not the Database Branch
The Git analogy is useful for isolation but misleading for promotion.
Databricks explicitly says Lakebase branches are not merged back into their parents. Both sides can change independently, making reconciliation of their data impractical. Schema changes instead live in version-controlled migrations beside the application code.
In the example, Drizzle applies the migration to the preview database and deployment automation applies it again when the change reaches the main branch. The guide also names Flyway, Liquibase and Alembic as alternatives.
Reviewers approve application changes and the instructions that transform the database. This preserves a familiar release boundary, without copying an agent’s entire working database into production.
The schema diff adds a second perspective: migration files show the intended operations, while the diff shows the resulting structural changes. Neither establishes that a data backfill is semantically correct, that a destructive operation is acceptable or that deployment will behave safely under production load. Those questions still require appropriate tests and review.

Two agents can independently produce valid migrations that collide when combined. Because parent changes do not automatically update children, a passing PR can also reflect an older parent state. Parallel branches do not eliminate these integration conflicts.
Teams should therefore rerun migration validation against the relevant current baseline before promotion. Branching removes interference during experimentation; the final migration sequence still needs coordination.
Production-Like Data Needs a Separate Security Decision
The example’s production-derived PR branches make tests more realistic, but operational isolation and data confidentiality are different protections. A child cannot modify its parent through ordinary branch-local changes. It still inherits data as well as schema, which may include sensitive information.