eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Create migration file when blueprint updated for data type stored in DB

Open steveparks opened this issue 1 year ago • 1 comments

Obviously a luxury-end feature request, but it'd be really handy!

At the moment, if a data type (eg users) is moved from static files to the database, and then the blueprint is updated (eg to add a job title field) — then you need to also manually create a database migration file and type in the lines to create each new column in the database table.

In an ideal world, I'd love it if Statamic created migration files whenever the blueprint was updated for a datatype that is stored in the database, and then prompted you to run the file with the correct command.

steveparks avatar Oct 10 '24 20:10 steveparks

Yeah agreed this would be nice, but unfortunately there are a lot of edge cases to think about (as an example how do you know if a field has been renamed versus it being deleted and a new one added).

Something to think about anyway.

ryanmitchell avatar Oct 11 '24 10:10 ryanmitchell