diff --git a/scripts/cloudron-support b/scripts/cloudron-support index 39398a4b4..267fbb407 100755 --- a/scripts/cloudron-support +++ b/scripts/cloudron-support @@ -864,7 +864,7 @@ function apply_patch() { } function check_db_migrations() { - local -r last_migration_from_db="$(mysql -NB -uroot -ppassword -e "SELECT name FROM box.migrations ORDER BY run_on DESC LIMIT 1" 2>/dev/null).js" + local -r last_migration_from_db="$(mysql -NB -uroot -ppassword -e "SELECT name FROM box.migrations ORDER BY run_on DESC, name DESC LIMIT 1" 2>/dev/null).js" local -r last_migration_file="/$(ls --ignore schema.sql --ignore initial-schema.sql /home/yellowtent/box/migrations/ | sort | tail -1)" if [[ "${last_migration_from_db}" != "${last_migration_file}" ]]; then fail "Database migrations are pending. Last migration in DB: ${last_migration_from_db}. Last migration file: ${last_migration_file}."