Adds ability to apply migrations without versioning #291
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.
Closes #259.
This implementation adds
no-versioning
support to all existing commands, effectively treating the provided directory as a source of truth. There should be no behaviour changes to existing (versioned) migrations.No version means "apply migrations without tracking them in the schema table".
A common use case might be (see linked ticker for even more context):
There are some limitations of
no-versioning
because we're not storing the history of applied migrations. Example:Say you have 5 seed migrations and are running the following commands repeatedly:
down
will only ever apply the last migration down. Runningup-by-one
will only ever apply the first migration up. Also, runningup-to
and then adown-to
won't work, since all unversioned migrations start at either the first or last migration.This limitation is expected, and most users will likely run
up
followed byreset
with the--no-versioning
flag (CLI) orWithNoVersioning()
library functional option.