-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Populate migration file with actual model fields #935
Conversation
modules/system/console/scaffold/migration/migration.create.stub
Outdated
Show resolved
Hide resolved
@mjauvin do you know if it's possible to write a unit test for this? |
What exactly would you like to test ? |
@mjauvin this should be easy to test - simply write out a couple of different form definitions and ensure that they are within the migration after the command is run. Or, if you don't want to parse the migration, you could run the migration and then check the table schema of the generated table. |
I wrote tests for the migration file generator. It's not perfect as the test uses the SQLite db which does not support all field types MySQL/PostgreSQL do, but it should be good enough. |
modules/system/tests/fixtures/plugins/winter/tester/models/testmodel/fields.yaml
Outdated
Show resolved
Hide resolved
@mjauvin final thing (apart from the test yaml indentation), is there a related PR to the docs? |
Done @LukeTowers |
Populate the migration file with fields from the fields definition file and model properties (relations, timestamps, etc.)
Associated docs PR: wintercms/docs#165