-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate migrations from blueprint #56
Comments
I was thinking about this the other day, nearly started a PR. It would also be good to have a Both are useful, because sometimes you already have an app with your migrations and models already existing, and other times on greenfield projects it would be good to use the blueprint builder to make the migration for you. |
Yeah that's a good idea. Didn't think about the other side of it. |
It would be a bit of guess work on what column is what fieldtype, but defaulting to text would be okay. Especially if the Statamic PR for addons registering their own blueprints gets merged, then you can go in and make the tweaks in the CP blueprint builder. |
I've created a pull request for creating migrations from blueprints, it's pretty much ready to merge, just need to check over it again. Would you mind opening another issue for the 'migration > blueprint' flow? As this one will be closed when the PR is merged. |
What would you like to see added?
This is something I've told a couple of people about but essentially, my plan at some point is to build a way to automatically generate database migrations, based on field configurations from your blueprint.
How would it work?
It would be smart enough to know which column type each builtin fieldtype should be and it would be clever to change that if
max_assets
is defined.If we don't know which column type to use (eg. custom fieldtype) we could maybe just leave it as a string/json column and give the user an error?
This would be some sort of command, like:
php please runway:migration order
Considerations
Is there a workaround you can use in the meantime?
You could just do it by hand, which is a bit of a sucky option because you then have to define everything twice.
Priority wise - where's this feature for you?
This is just a nice to have. I can deal without.
The text was updated successfully, but these errors were encountered: