cloudron-support: with equal timestamps, order by name
This commit is contained in:
@@ -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}."
|
||||
|
||||
Reference in New Issue
Block a user