From lovable
Checks for pending Supabase migrations and generates Lovable prompts to apply them. Also supports automated application via yolo mode.
How this command is triggered — by the user, by Claude, or both
Slash command
/lovable:apply-migrationThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Apply Database Migration Check for pending migrations and generate Lovable deployment prompts. ## Instructions 1. **List migration files**: - Show all files in `supabase/migrations/` - Sort by timestamp (filename prefix) 2. **Show migration content** for review: 3. **Warn about destructive operations**: - Check for: DROP, DELETE, TRUNCATE, ALTER...DROP - If found: 4. **Generate deployment prompt**: Or for review first: 5. **Suggest verification**: 6. **Remind about CLAUDE.md**: - If new tables created, update database tables section ## Check for Yolo Mode Af...
Check for pending migrations and generate Lovable deployment prompts.
List migration files:
supabase/migrations/Show migration content for review:
-- Migration: [filename]
[SQL content]
⚠️ **Destructive operation detected!**
This migration contains: [operation]
Ensure you have a backup before proceeding.
📋 **LOVABLE PROMPT:**
> "Apply pending Supabase migrations"
Or for review first:
📋 **LOVABLE PROMPT:**
> "Review and apply the migration [filename]"
After applying, verify:
> "Show me the [table_name] table structure"
After generating the prompt, check if yolo mode is enabled:
Read CLAUDE.md:
## Yolo Mode Configuration (Beta) sectionStatus fieldTesting and Debug Mode settingsIf Status: on:
/skills/yolo/SKILL.md)Testing: on
e. Show deployment summaryIf Status: off or not found:
💡 **Tip:** Automate migrations with yolo mode!
Run: /lovable:yolo on
Benefits: No manual copy-paste, automatic testing
## Pending Migrations
### 20250101120000_add_profiles_table.sql
```sql
CREATE TABLE profiles (
id UUID PRIMARY KEY REFERENCES auth.users(id),
full_name TEXT,
avatar_url TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Users can view own profile"
ON profiles FOR SELECT
USING (auth.uid() = id);
✅ No destructive operations detected.
📋 LOVABLE PROMPT:
"Apply pending Supabase migrations"
After applying:
"Show me the profiles table structure"
💡 Remember to update CLAUDE.md with the new table.
💡 Tip: Automate migrations with yolo mode! Run: /lovable:yolo on Benefits: No manual copy-paste, automatic testing
### Example 2: Yolo Mode Enabled (Automated)
✅ No destructive operations detected. ✅ Committed and pushed to main
🤖 Yolo mode: Applying Supabase migrations
⏳ Step 1/8: Navigating to Lovable project... ⏳ Step 2/8: Waiting for GitHub sync... ✅ Step 3/8: Sync verified - Lovable has latest code ✅ Step 4/8: Located chat interface ✅ Step 5/8: Submitted prompt: "Apply pending Supabase migrations" ⏳ Step 6/8: Waiting for Lovable response... ✅ Step 7/8: Migration confirmed ⏳ Step 8/8: Running verification tests... ✅ Step 8/8: All tests passed
Operation: Database Migration Migration: 20250101120000_add_profiles_table.sql Status: ✅ Success Duration: 42 seconds
Verification Tests:
Next Steps:
💡 Yolo mode is enabled. Run /lovable:yolo off to disable.
npx claudepluginhub 10k-digital/lovable-claude-code --plugin lovable/migrateAuto-detects ORM/migration tool and generates idiomatic database migrations with backward compatibility checks, rollback validation, lock estimates. Applies, rolls back, or shows status via flags.
/migrationCreates and manages database migrations with up/down patterns, supporting multiple database types and ORMs. Also supports status checks and rollback operations.
/fire-migrate-databaseGuides migration between PostgreSQL, MySQL, SQLite, and SQL Server through a 6-step pipeline: assess, plan, execute, and verify. Accepts optional direction, source, and target arguments.
/d1-migrationManages Cloudflare D1 migrations — generate from schema changes, apply pending migrations, fix stuck migrations, or show status.
/plan-migrationPlan safe schema migration with backward compatibility and rollback strategy.
/d1-create-migrationGuides creation of Cloudflare D1 database migrations with schema validation, SQL generation, and testing workflow. Supports adding tables, modifying columns, indexes, and data migrations.