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

Fix Issue #685: Corrections and Improvements in Model and Migration Generation #694

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AaronLil
Copy link

@AaronLil AaronLil commented Aug 7, 2024

This pull request addresses the problem reported in issue #685 and includes a series of corrections and enhancements to the generation process for both models and migrations in the Blueprint package.

Key Corrections and Enhancements:

  1. Model Generation:
  • Corrected method naming issues for relationships involving columns with non-standard Laravel naming conventions.
  • Fixed duplicate method names for multiple relationships to the same table.
  • Ensured proper handling of foreign key references, including support for Fully Qualified Names (FQNs) and custom relationship names.
  • Refined logic to avoid method name collisions and to respect Laravel's naming conventions.
  1. Migration Generation:
  • Ensured accurate handling of table and column specifications, including correct generation of foreign keys and relationships.
  • Enhanced processing of column attributes to correctly handle nullable and other modifiers.
  • These changes significantly improve the reliability and adherence to Laravel standards in the generation processes, addressing both the specific issues reported and enhancing overall functionality.

These updates have been tested thoroughly to ensure compatibility and correctness, and we believe they will provide a more robust and predictable experience for Blueprint users.

- Fixed the logic for determining the table and column names when building foreign key constraints in migrations.
- Ensured the correct mapping of table and column names to accurately generate foreign key constraints as specified in the YAML configuration.
  - Corrects method naming issues for relationships involving columns with non-standard Laravel naming conventions.
  - Fixes duplicate method names for multiple relationships to the same table.
  - Ensures proper handling of foreign key references, including support for Fully Qualified Names (FQNs) and custom relationship names.
  - Refines logic to avoid method name collisions and respects Laravel's naming conventions.
@jasonmccreary
Copy link
Collaborator

Looks like the build is broken. Not sure if this is your code or existing. Either way, it'd be good to see some tests around the changes you made.

@AaronLil AaronLil marked this pull request as draft August 7, 2024 22:55
@AaronLil
Copy link
Author

AaronLil commented Aug 7, 2024

I don't know much about testing and phpunit, but I'll take a look. It's probably just a matter of adapting the tests to the new internal relationship syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants