Replies: 2 comments 1 reply
-
@Ontopic At this time there is not a Payload specific way of dealing with this. It is an issue common to MongoDB and databases in general so there are some good resources about how to write scripts for handling a migration change strategy. In the future we plan to have a recommended way of dealing with the problem of schema changes on live data. What exactly the solution will be is to be determined. We will be interested in solutions from the community and any feedback on what we decide. I agree with you that it is something to be careful about. In my experience the developers that swear off using schemaless databases have been burned by poor data structure or missmanaging schema changes. That makes it important to get this right. |
Beta Was this translation helpful? Give feedback.
-
Man Payload looks amazing! I am getting ready to scope out a new project and came across Payload. It and its community seem perfect for it. One thing that seems missing is a way to handle data migrations. I like that the open ended nature of it's structure allows one to build it in themselves. With that said is there any update on when something like this could be added in the future? I apologize if I missed something. I tried checking in issues and here in discussions and that is when I found this thread. |
Beta Was this translation helpful? Give feedback.
-
Often it is enough to simply restart Payload when you've changed your configuration. When renaming fields or changing their type a reset or remapping is needed. For development purposes with a seed script this is simple; I run
make fresh
and be done with it. Now in production I'm sure the editors wouldn't like that very much so that "feature" has been carefully guarded in production.Now, of course changes to the structure are necessary in production sometimes as well. So far I'm not really sure I ever saw anything about this in any documentation or discussion, but perhaps I overlooked this. I have been running a staging environment with minimal migration scripts to test maintaining content and changing collections, which seem to be working fair enough. I'm wondering what others are using or thinking on this subject though, since it feels like something I should be more careful about.
Beta Was this translation helpful? Give feedback.
All reactions