Fork, Fix, Delete: Safe Database Migrations with GitHub Copilot and Tiger Cloud
What I Built A safe production workflow for fixing slow time-series queries without ever touching prod. The problem: Direct fixes on Postgres are risky. A bad index, a wrong type, or a long ALTER TABLE can lock production. My solution: Fork / Fix / Delete using GitHub Copilot Agent Mode + Tiger Cloud MCP. FORK: Copilot called tiger_create_fork and cloned my live service db-63453 into…
Directly altering production databases can be risky and lead to severe issues. To avoid such problems, a safe workflow for fixing slow time-series queries can be achieved using GitHub Copilot Agent Mode and Tiger Cloud MCP. The process involves three main steps: FORK, FIX, and DELETE.
In the FORK step, GitHub Copilot uses the tiger_create_fork command to clone the live service database into a separate test environment. This allows for isolated testing without affecting the production database. The database clone created is db-63453-test.
Next, in the FIX step, the developer reproduces the slow query inside the forked database. They utilize EXPLAIN ANALYZE to understand the query performance and convert the table to a hypertable. They also change timestamp types to timestamptz and add proper time-based indexes. The Tiger Cloud MCP's Dump & Restore feature is used to migrate the tables.
Finally, in the DELETE step, the fork is removed using the tiger_delete_service command. This step ensures that the production database remains untouched and ready for use. The process guarantees that any development errors or misconfigurations are safely contained within the isolated fork environment.
After implementing this workflow, the production database is once again ready, with a 29-day trial left. The fork containing the experimental fixes is no longer present, leaving only the original production database. Monitoring after the fix shows clean checkpoint logs, with no lock or fatal errors, as expected. The video demonstrating this workflow can be found at https://www.loom.com/share/48bb136113c14fa881559b259e4732c4.
The GitHub repository containing the code and configuration files for this process is available at https://github.com/your-username/tiger-fork-fix-delete.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.