---
name: safe-database-migration-testing-in-sandboxes
description: "Tests proposed database migrations and queries against an isolated sandbox replica, reporting schema errors and lock timeouts. Use when a new migration script needs validation before deployment."
license: CC-BY-4.0
compatibility: "Needs access to: Database, Terminal, GitHub."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-16"
  source: "https://botbento.com/usecases/safe-database-migration-testing-in-sandboxes/"
  kind: workflow
  hermes:
    tags: ["database", "migrations", "postgres", "testing"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Safe database migration testing in sandboxes

Validate schema migrations and queries in isolated database clones before deployment

## When to use

Automatically provision an isolated sandbox replica to test proposed schema updates, indexing strategies, and database queries. Verify that scripts execute cleanly without locking or corruption before submitting pull requests.

## Inputs

- `migration_script`: The proposed schema migration script to execute against the sandbox database.
- `sandbox_database`: Connection details for the isolated branch database where tests run.
- `test_queries` (optional): Optional queries to run against the sandbox to evaluate execution plans.

## Steps

1. When something happens: New migration script submitted (A new migration script is submitted)
2. Run tests on sandbox database
3. Deliver execution report

## Instructions

Connect to the sandbox environment using your terminal tool. When a migration script is submitted, run the schema alterations and test queries against the isolated branch database. Evaluate query execution plans and report any lock timeouts or schema errors. Do not apply changes to shared environments or submit a pull request to GitHub without explicit user approval.

## Approvals

- Applying changes to shared environments requires explicit user approval.
- Submitting a pull request to GitHub requires explicit user approval.

## Output

Execution report detailing schema errors, lock timeouts, and query execution plans from the sandbox run. (format: document)

## Source

Summarized in our own words from [Launch HN: Ardent (YC P26) – Postgres sandboxes in seconds with zero migration](https://news.ycombinator.com/item?id=48124436) (Hacker News, checked 2026-10-16). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/safe-database-migration-testing-in-sandboxes/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
