Files
tg_tinder_bot/bin/run_full_migration.sh
2025-11-06 15:09:15 +09:00

38 lines
1.3 KiB
Bash
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.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# run_full_migration.sh - Полный процесс миграции с компиляцией TypeScript
echo "🚀 Запуск полного процесса миграции..."
# Проверка наличия файлов TS
if find migrations -name "*.ts" -quit; then
echo "📋 Обнаружены TypeScript миграции. Компилируем их..."
# Компиляция TS файлов
./bin/compile_ts_migrations.sh
# Проверка результата
if [ $? -ne 0 ]; then
echo "❌ Ошибка компиляции TS миграций!"
exit 1
fi
else
echo " TypeScript миграции не обнаружены, пропускаем компиляцию."
mkdir -p temp_migrations
fi
# Копирование JS миграций
echo "📂 Копирование JS-миграций..."
find migrations -name "*.js" -exec cp {} temp_migrations/ \;
# Запуск миграций
echo "🔄 Применение всех миграций..."
./bin/apply_migrations.sh
# Проверка результата
if [ $? -eq 0 ]; then
echo "✅ Процесс миграции успешно завершен!"
else
echo "❌ Ошибка в процессе миграции."
exit 1
fi