apply-migration

Apply SQL migration files to JusticeHub Supabase database with verification and error handling.

16 stars

Best use case

apply-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Apply SQL migration files to JusticeHub Supabase database with verification and error handling.

Teams using apply-migration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/apply-migration/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/apply-migration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/apply-migration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How apply-migration Compares

Feature / Agentapply-migrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Apply SQL migration files to JusticeHub Supabase database with verification and error handling.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Apply Database Migration

**Invocation**: `/apply-migration <migration-file>`

## Usage

```bash
/apply-migration 20260102_alma_unification_links.sql
```

## How It Works

1. Reads migration from `supabase/migrations/`
2. Connects to Supabase using `.env.local` credentials
3. Executes SQL via direct PostgreSQL connection
4. Verifies created tables/columns
5. Logs success/failure

## Prerequisites

- `.env.local` with `NEXT_PUBLIC_SUPABASE_URL`, `SUPABASE_DB_PASSWORD`
- Migration file in `supabase/migrations/`
- `pg` library installed

## Connection

```
postgresql://postgres:PASSWORD@HOST:6543/postgres
```

Fallback to session pooler if direct fails.

## Success Output

```
✅ Migration executed successfully!
🔍 Verifying tables...
   ✅ article_related_interventions
   ✅ alma_intervention_profiles
🎉 Migration Complete!
```

## Failure Output

```
❌ Error: syntax error at or near "CRATE"

📋 Manual alternative:
   1. Open Supabase Dashboard → SQL Editor
   2. Copy from: supabase/migrations/bad_migration.sql
   3. Fix syntax and run
```

## Safety Features

- Transaction safety
- Idempotent checks (`IF NOT EXISTS`)
- Proper connection cleanup
- Backup reminder

## Files

- Script: `scripts/apply-migration-skill.mjs`
- Migrations: `supabase/migrations/*.sql`

## Related

- `/create-migration` - Generate new migration
- `/verify-schema` - Check database schema

Related Skills

claude-opus-4-5-migration

16
from diegosouzapw/awesome-omni-skill

Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls to use Opus 4.5. Handles model string updates and prompt adjustments for known Opus 4.5 behavioral differences. Does NOT migrate Haiku 4.5.

airflow-3x-migration

16
from diegosouzapw/awesome-omni-skill

Comprehensive guide and patterns for migrating Apache Airflow 2.x workflows to Airflow 3.x, covering import changes, deprecated features, and new paradigms like Asset scheduling and TaskFlow API.

tuist-migration

16
from diegosouzapw/awesome-omni-skill

Integrates Tuist into an existing iOS project that uses SPM local packages. Use when migrating a project from a manually maintained .xcodeproj to a Tuist-generated project, adding Tuist as an orchestration layer on top of SPM. Covers 8 sequential phases — audit, base structure, helpers, generation, schemes, CI, cache, and validation. Includes automation scripts and AI prompt templates for each phase.

Schema Migration

16
from diegosouzapw/awesome-omni-skill

Create safe, zero-downtime schema migrations with rollback procedures

Migration Planner

16
from diegosouzapw/awesome-omni-skill

Plan safe, zero-downtime migrations for schemas, services, and infrastructure

database-migrations-sql-migrations

16
from diegosouzapw/awesome-omni-skill

SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server

database-migration

16
from diegosouzapw/awesome-omni-skill

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data tr...

alembic-migration-manager

16
from diegosouzapw/awesome-omni-skill

A skill for managing database migrations with Alembic. Use this for tasks involving Alembic initialization, configuration, creating new migration scripts (both autogenerated and manual), defining upgrade and downgrade logic, handling data migrations, testing migrations, performing rollbacks, and following production deployment best practices for database changes.

migration-guides

16
from diegosouzapw/awesome-omni-skill

Migration guides - from other AI tools, version upgrades, config migration. Use when switching from Cursor, Copilot, or Cody, upgrading Claude Code versions, or migrating configurations and customizations.

aqe-v2-v3-migration

16
from diegosouzapw/awesome-omni-skill

Migrate Agentic QE projects from v2 to v3 with zero data loss

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

moai-lang-r

16
from diegosouzapw/awesome-omni-skill

R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.