From 7371dd6db0e3d44ba05df9bf3d639fb08f80e33d Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Sat, 8 Nov 2025 17:01:35 +0300 Subject: [PATCH] fix: Simplify SQL command for creating migrations tracking table in update script --- update.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/update.sh b/update.sh index c996557..a8fdcef 100755 --- a/update.sh +++ b/update.sh @@ -123,15 +123,8 @@ if [ -z "$MIGRATIONS" ]; then echo -e "${YELLOW}⚠ No migration files found${NC}" else # Create migrations tracking table if not exists - $DOCKER_COMPOSE exec -T db mysql -uroot -p$DB_ROOT_PASS amnezia_panel </dev/null || \ - $DOCKER_COMPOSE exec db mysql -uroot -p$DB_ROOT_PASS amnezia_panel </dev/null -CREATE TABLE IF NOT EXISTS schema_migrations ( - id INT PRIMARY KEY AUTO_INCREMENT, - filename VARCHAR(255) UNIQUE NOT NULL, - applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_filename (filename) -); -EOF + $DOCKER_COMPOSE exec -T db mysql -uroot -p$DB_ROOT_PASS amnezia_panel -e "CREATE TABLE IF NOT EXISTS schema_migrations (id INT PRIMARY KEY AUTO_INCREMENT, filename VARCHAR(255) UNIQUE NOT NULL, applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX idx_filename (filename));" 2>/dev/null || \ + $DOCKER_COMPOSE exec db mysql -uroot -p$DB_ROOT_PASS amnezia_panel -e "CREATE TABLE IF NOT EXISTS schema_migrations (id INT PRIMARY KEY AUTO_INCREMENT, filename VARCHAR(255) UNIQUE NOT NULL, applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX idx_filename (filename));" 2>/dev/null # Apply each migration APPLIED_COUNT=0