migrate-db

Run Supabase database migrations against linked project instances.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/clenisa/optimal-cli --skill migrate-db-clenisa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-db
Source: https://github.com/clenisa/optimal-cli/tree/main/skills/migrate-db
Command: npx skills add https://github.com/clenisa/optimal-cli --skill migrate-db-clenisa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the safe application of Supabase schema migrations across ReturnPro and OptimalOS instances, preventing manual SQL edits and inconsistent database states.

Core Features & Use Cases

  • Instance resolution: Maps logical instance names to their project directories for ReturnPro and OptimalOS.
  • Migration file management: Optionally create timestamped migration files from provided SQL content before applying.
  • Safe deployment: List pending migrations, run dry-run inspections, push schema changes using supabase db push --linked, verify application, and log activity.
  • Use case: Prepare and apply a budget schema change to ReturnPro by creating the migration file, reviewing pending migrations in dry-run, and then applying the change.

Quick Start

Run the migrate-db skill to push pending migrations to the ReturnPro instance in dry-run mode to verify pending changes before applying.

Frequently Asked Questions about migrate-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply Supabase database migrations to a linked project instance?

To apply Supabase database migrations, the skill resolves the target instance to its project directory and runs the migration process to push pending schema changes using the Supabase CLI. It verifies the application and logs the activity to the project's activity log.

Can I perform a dry run before pushing Supabase schema changes?

Yes, you can perform a dry run to inspect pending Supabase schema changes before applying them. This allows you to review pending migrations safely and verify the changes without altering the actual database state.

How do I create a timestamped migration file for Supabase?

You can create timestamped migration files by providing SQL content to the migration tool. It generates the appropriately named file in the resolved project directory, allowing you to prepare and apply schema changes like a budget update to ReturnPro or OptimalOS.

Do I need the Supabase CLI installed to run database migrations?

Yes, you need the Supabase CLI installed to run database migrations against linked project instances. The migration process relies on the CLI to list pending migrations, perform dry runs, and push schema changes to the target Supabase project.

What is the best way to manage database migrations for ReturnPro and OptimalOS Supabase projects?

The best way to manage database migrations for ReturnPro and OptimalOS is to use an automated migration tool that resolves logical instance names to project directories. This prevents manual SQL edits and ensures consistent database states by applying pending schema changes safely.