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

54 lines
2.1 KiB
Bash
Raw 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.
#!/bin/bash
# Script para aplicar migrations usando Supabase CLI
echo "╔═══════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ 🚀 APLICANDO MIGRATIONS - SUPABASE RDO ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════════╝"
echo ""
# Project ID
PROJECT_ID="ympbgdymeesivfajmgat"
echo "📍 Projeto: $PROJECT_ID"
echo ""
# 1. Linkar projeto
echo "1⃣ Linkando projeto Supabase..."
supabase link --project-ref $PROJECT_ID
if [ $? -ne 0 ]; then
echo "❌ Erro ao linkar projeto"
exit 1
fi
echo "✅ Projeto linkado com sucesso!"
echo ""
# 2. Aplicar migrations
echo "2⃣ Aplicando migrations..."
supabase db push
if [ $? -ne 0 ]; then
echo "❌ Erro ao aplicar migrations"
exit 1
fi
echo "✅ Migrations aplicadas com sucesso!"
echo ""
# 3. Verificar
echo "3⃣ Verificando..."
node check-supabase-status.js
echo ""
echo "╔═══════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ ✅ TUDO PRONTO! ║"
echo "║ ║"
echo "║ Próximo passo: npm run dev ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════════╝"