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
If you run "goose down" goose will write a new row to the database with is_applied set to false, so there will be two rows for the same version; one with is_applied true and a newer one with is_applied set to false.
The key to determining the application state is to look at the most recent row for each version. You likely want a query like this:
WITH most_recent_migration AS (
SELECT DISTINCTON (version_id) version_id, is_applied, id
FROM goose_db_version
ORDER BY version_id, id DESC
)
SELECT version_id FROM most_recent_migration
WHERE is_applied = true
ORDER BY id DESC
This is a bad pattern because it can easily lead to errors, however I'm not sure what to do about it.
The text was updated successfully, but these errors were encountered:
If you run "goose down" goose will write a new row to the database with
is_applied
set to false, so there will be two rows for the same version; one withis_applied
true and a newer one withis_applied
set to false.The key to determining the application state is to look at the most recent row for each
version
. You likely want a query like this:This is a bad pattern because it can easily lead to errors, however I'm not sure what to do about it.
The text was updated successfully, but these errors were encountered: