Skip to content
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

Merged
merged 46 commits into from
Nov 1, 2023

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Jul 4, 2023

Populate the migration file with fields from the fields definition file and model properties (relations, timestamps, etc.)

Associated docs PR: wintercms/docs#165

@LukeTowers LukeTowers modified the milestones: v1.2.3, v1.2.4 Jul 7, 2023
@LukeTowers
Copy link
Member

@mjauvin do you know if it's possible to write a unit test for this?

@mjauvin
Copy link
Member Author

mjauvin commented Oct 20, 2023

@mjauvin do you know if it's possible to write a unit test for this?

What exactly would you like to test ?

@bennothommo
Copy link
Member

@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.

@mjauvin
Copy link
Member Author

mjauvin commented Oct 21, 2023

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.

@LukeTowers
Copy link
Member

@mjauvin final thing (apart from the test yaml indentation), is there a related PR to the docs?

@mjauvin
Copy link
Member Author

mjauvin commented Oct 26, 2023

Done @LukeTowers

@LukeTowers LukeTowers merged commit 9486aca into develop Nov 1, 2023
11 checks passed
@LukeTowers LukeTowers deleted the create-migration branch November 1, 2023 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants