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
For historic reasons, adding a GetLatestVersion query was challenging because goose did not hard-delete rows and instead marked them with is_applied = false. Which means you'd end up with something like this:
| id | version_id | is_applied ||----|------------|------------|| 1 | 0 | t || 2 | 1 | t || 3 | 2 | t || 4 | 2 | f |
See #131 (review) where we changed the underlying implementation to hard-delete the row.
This is why we list versions (in reverse order by id, or in rare circumstances the timestamp) and then get the highest version that has is_applied = true and that hasn't been previously deleted. But this is wasteful, since we query the entire table and discard 99% of the results on the client. Granted we probably could have done this with SQL, but this is easy to mess up across implementations.
In the new Provider, this functionality does not exist, so we can expand the interface to accommodate for a "get latest" query to avoid listing all versions.
Note
Latest version can mean 2 different things:
Latest version is the max by version_id
Latest version is the last applied migration by id or timestamp, irrespective of the version. This becomes especially important for out-of-order migrations.
The text was updated successfully, but these errors were encountered:
For historic reasons, adding a
GetLatestVersion
query was challenging because goose did not hard-delete rows and instead marked them withis_applied = false
. Which means you'd end up with something like this:See #131 (review) where we changed the underlying implementation to hard-delete the row.
This is why we list versions (in reverse order by id, or in rare circumstances the timestamp) and then get the highest version that has
is_applied = true
and that hasn't been previously deleted. But this is wasteful, since we query the entire table and discard 99% of the results on the client. Granted we probably could have done this with SQL, but this is easy to mess up across implementations.In the new
Provider
, this functionality does not exist, so we can expand the interface to accommodate for a "get latest" query to avoid listing all versions.Note
Latest version can mean 2 different things:
The text was updated successfully, but these errors were encountered: