apply-migration
FreeNo executable scriptsNot checkedApply SQL migration files to JusticeHub Supabase database with verification and error handling.
by diegosouzapw★ 68 GitHub starsAbout this skill
Apply Database Migration
Invocation: /apply-migration <migration-file>
Usage
/apply-migration 20260102_alma_unification_links.sql
How It Works
- Reads migration from
supabase/migrations/ - Connects to Supabase using
.env.localcredentials - Executes SQL via direct PostgreSQL connection
- Verifies created tables/columns
- Logs success/failure
Prerequisites
.env.localwithNEXT_PUBLIC_SUPABASE_URL,SUPABASE_DB_PASSWORD- Migration file in
supabase/migrations/ pglibrary 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
Install apply-migration in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the apply-migration skill do?
Apply SQL migration files to JusticeHub Supabase database with verification and error handling.
How do I install the apply-migration skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the apply-migration skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic