Update Field Config? (grid)
Created 4 years ago by vinnydude

How do I go about updating a fields config after a migration? I'd normally just go into the database and update it there, but with the Grid field type, it's not quite as straight forward, doable, but not ideal!

I've had a look in the Grid docs and it says you can update the config via the API, but that is literally all it says!

So how do I go about updating the related grids for a module?

ryanthompson  —  4 years ago

You can use a migration to edit the fields as needed something like this: https://pyrocms.com/documentation/streams-platform/1.7/database/migrations#using-repositories

You would get the field or assignment using $this->fields() or $this->assignments() instead and just change the config attribute accordingly and then save. Schema and all that will remain in tact.