[drizzle-kit] Add push flag for safe use in non-interactive CI #4384
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.
I know the docs suggest using
drizzle-kit push
in CI is a bad idea, but it works fine if you only do backward-compatible changes, and thepush
command is so close to supporting this use-case.All it needs is an option to only to non-destructive stuff, which I've added here as a
--safe
flag.I just put this up as a feeler covering the most basic use case of data loss. It should also handle things like making a column
unique
ornotNull
, by defaulting to try the change in a safe way (option 0), failing if it doesn't work.Usage example
Todo
--safe
? Could be--no-data-loss
or--non-interactive
...?Relevant issues
#3209