---
name: testing-database-migrations-across-isolated-worktrees
description: "Runs migration checks for pull requests and branch tasks in isolated ephemeral databases, applying proposed SQL migrations and executing automated test suites. Use when code changes include database migrations that need verification before merge."
license: CC-BY-4.0
compatibility: "Needs access to: GitHub, Terminal, Database."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/testing-database-migrations-across-isolated-worktrees/"
  kind: workflow
  hermes:
    tags: ["migrations", "testing", "databases", "git"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Testing database migrations across isolated worktrees

Run coding tasks in parallel branches with isolated database instances to verify schema migrations.

## When to use

When multiple automated development tasks run simultaneously, shared databases cause schema collisions and race conditions. This workflow provisions temporary, isolated database instances for each feature branch or worktree, applies proposed SQL migrations, executes automated test suites, and reports results.

## Inputs

- `pull_request_or_branch`: The pull request or branch task containing the code and schema changes to verify.
- `migration_files`: SQL migration files proposed in the branch to apply against the isolated database instance.
- `test_suite` (optional): Automated test suite to execute against the live migrated database instance.

## Steps

1. When something happens: Pull request or branch updated (A pull request or branch task is updated with database migrations or code changes)
2. Run migrations against sandbox DB
3. Share test report for review

## Instructions

Inspect new pull requests or branch tasks for database migrations and code changes. Spin up an isolated ephemeral database instance in the terminal and execute schema migrations. Run the test suite against the live instance. Collect logs, migration diffs, and test outputs. Request user approval before tearing down resources, dropping databases, or posting summary comments back to the repository.

## Approvals

- Tearing down ephemeral database instances and other provisioned resources
- Dropping sandbox databases
- Posting summary comments back to the repository

## Output

Test report with migration diffs, logs, and test suite results shared for review. (format: markdown)

## Source

Summarized in our own words from [Show HN: Supapool – a Supabase per coding agent in ~400 ms](https://news.ycombinator.com/item?id=49100518) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/testing-database-migrations-across-isolated-worktrees/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
