Files
RDO/scripts/apply-migrations.ps1
2026-02-20 07:25:32 -03:00

49 lines
2.2 KiB
PowerShell
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env pwsh
# Script para aplicar migrations usando Supabase CLI (Windows)
Write-Output "`n╔═══════════════════════════════════════════════════════════════╗"
Write-Output "║ ║"
Write-Output "║ 🚀 APLICANDO MIGRATIONS - SUPABASE RDO ║"
Write-Output "║ ║"
Write-Output "╚═══════════════════════════════════════════════════════════════╝`n"
# Project ID
$PROJECT_ID = "mnwrnblzabxgqtgjwxgl"
Write-Output "📍 Projeto: $PROJECT_ID`n"
# 1. Linkar projeto
Write-Output "1⃣ Linkando projeto Supabase..."
supabase link --project-ref $PROJECT_ID
if ($LASTEXITCODE -ne 0) {
Write-Output "❌ Erro ao linkar projeto"
exit 1
}
Write-Output "✅ Projeto linkado com sucesso!`n"
# 2. Aplicar migrations
Write-Output "2⃣ Aplicando migrations..."
supabase db push
if ($LASTEXITCODE -ne 0) {
Write-Output "❌ Erro ao aplicar migrations"
exit 1
}
Write-Output "✅ Migrations aplicadas com sucesso!`n"
# 3. Verificar
Write-Output "3⃣ Verificando..."
node check-supabase-status.js
Write-Output "`n╔═══════════════════════════════════════════════════════════════╗"
Write-Output "║ ║"
Write-Output "║ ✅ TUDO PRONTO! ║"
Write-Output "║ ║"
Write-Output "║ Próximo passo: npm run dev ║"
Write-Output "║ ║"
Write-Output "╚═══════════════════════════════════════════════════════════════╝`n"