CLI command for generating migration functions and checking state changes #2424
Closed
matthijs166
started this conversation in
Feature Requests & Ideas
Replies: 2 comments
-
Thanks for opening this, I've been wanting to wait to mention this until the new database providers are in, this CLI tool would be expected to work with all providers that come with Payload. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, we do not have an automated way of generating up and down migration functions when I add, change, or delete fields in my schema. This process can be tedious and error-prone, and it requires manual effort to run migration scripts. Therefore, I propose adding a new CLI command that sets the state of the current scheme and compares it to the state after changes. For every field that is added, changed, or deleted, this command can generate up and down migration functions automatically.
I have looked at similar tools, such as the migrate-mongo-example package on GitHub, but I believe that having an integrated solution within my CLI would be more convenient for my workflow. Additionally, I would like to integrate this feature into my CI pipeline, so that it automatically checks for any changes before deploying to production.
Furthermore, I believe that versioning is critical for data integrity, and I would like to leverage my existing versioning system in this feature. By incorporating versioning, I can ensure that data is never truly lost and that I have a historical record of all changes.
Ideas to improve this feature:
By implementing this feature, we can save time and reduce errors in the migration process, automate the migration process, and improve the overall data integrity of our applications.
Beta Was this translation helpful? Give feedback.
All reactions