-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Synopsis:
I'm using blueprint to speed up my development workflow, and it's really great for this. At the start, I especially liked it to make changes in the draft.yaml and then rerun the whole thing. And check the effect of the changes and learn from that. Getting confidence in the tool etc... I used this handy oneliner for this
php artisan blueprint:erase && php artisan blueprint:build && php artisan migrate:fresh
Once the models kind of felt right as a basis to start on, I extended some of them a bit, edited some of the other files and wrote some more custom stuff. Important changes I of course adjusted as well in draft.yaml. To keep track of everything, I committed everything it to git.
Then I returned back to my draft.yaml and wanted to start working on the controllers section in the same iterative way as before. This works for everything, except for the migrations.
I can easily track my customisations (e.g. to factories, to the models) because of git. But this is not the case for the migrations, as their filename depends on the moment they are created. Which makes it a bit of a pain to track the differences as soon as you go above 10 tables.
I'm fully aware blueprint is for fast prototyping, and that the use case I'm describing is a bit differing from the initial thought. But prototyping on the other hand is an iterative process where you learn by doing and adjusting and pivot around your requirements. And to be sure not to loose work/overview or to be able to share with others, git is an essential part of this workflow.
Proposed Syntax:
Not really sure which way forward to recommend.
- Maybe a flag for
blueprint:build --reusetimestamps
that makes migrations keep the original timestamp in their name. But then again, I have no clue where (and if) you would store that kind of information, and how diffi - Maybe a flag for
blueprint:build --fakedatemigrations 2020-06-11 20:00
that gives migrations a fake date (e.g. the one specified) and than adds a second for each migration that is created in the order they are specified in the draf.yaml file. - ???
Expected Behavior:
Migrations with a constant (consistent) timestamp so that tracking differences with version control becomes easier/possible.