cloudron-support: with equal timestamps, order by name

This commit is contained in:
Girish Ramakrishnan
2025-12-02 09:33:55 +01:00
parent d906771b18
commit 1cbad1057d

View File

@@ -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}."