Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrations can now be marked as backwards compatible. Backwards compatibility is transitive, for example, if
v2
is backwards compatible withv1
andv3
is backwards compatible withv2
,v3
is also backwards compatible withv1
.When a document is loaded with a
migrationVersion
greater than the latest migration version the server has, the document will be loaded as long as it is backwards compatible with the server version.A
lastCompatibleVersion
is saved to a document when it's created or when it's migrated to a new version. IflastCompatibleVersion
isnil
because the document existed before this feature was added and hasn't had a migration since, Lapis will assume that the document isn't backwards compatible with any version.If a migration's
backwardsCompatible
value is changed after the fact, it won't affect documents until and unless the documents are created for the first time or they are migrated to a new version.I chose this behavior because if you joined a server with the old
backwardsCompatible
value after joining a server with the new one, it would recalculatelastCompatibleVersion
to be an incorrect version.The alternative that was ruled out was recalculating
lastCompatibleVersion
every time a document was loaded.