You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the node ace migration:status command, the exit code is always 0, even if there are pending migrations. This behavior makes it difficult to use the command in contexts like Kubernetes startup probes, where it is important to know if all migrations have been completed.
I've now written a script that allows me to check the output of the command:
#!/bin/bash# Run the migration status command and capture the output
output=$(node ace migration:status)# Check if the output contains the word "pending"ifecho"$output"| grep -q "pending";thenecho"Some migrations are pending:"# Extract the names of the pending migrationsecho"$output"| grep "pending"| awk -F'│''{print $2}'| sed 's/ //g'exit 1
elseecho"All migrations are completed."exit 0
fi
Is it possible to return a status error code? I don't know if this could have an impact on other behaviours, or if we could add a flag that would make it easy to find out if the migrations are ready to balance our application's traffic.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When running the
node ace migration:status
command, the exit code is always0
, even if there are pending migrations. This behavior makes it difficult to use the command in contexts like Kubernetes startup probes, where it is important to know if all migrations have been completed.I've now written a script that allows me to check the output of the command:
Is it possible to return a status error code? I don't know if this could have an impact on other behaviours, or if we could add a flag that would make it easy to find out if the migrations are ready to balance our application's traffic.
Beta Was this translation helpful? Give feedback.
All reactions