forked from laravel-shift/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/add ulid column type #3
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The change updates the regular expression in Blueprint.php to match 'ulid' and 'uuid' both. The update will reflect in the functionality where these matches are used for id creation.
A ULID shorthand has been introduced to the MigrationGeneratorTest, allowing ULID fields to be easily added through drafts. This is captured in new tests and the corresponding fixture files, validating its successful integration.
ULID column type has been added to the FactoryGenerator and corresponding tests. This update augments the list of column data types that can be used, particularly aiding situations where a universally unique lexicographically sortable identifier (ULID) is required. Test fixtures are updated to validate this new addition.
The ULID column type has been added to the 'all-column-types' test fixture.
Two new files were created to handle the case of a ulid shorthand with an invalid relationship. This includes a test case in the MigrationGeneratorTest.php file and a matching migration file. A draft file for ulid-shorthand-invalid-relationship was also added to the fixtures folder.
A new test for the case of a ULID without a relationship was added in MigrationGeneratorTest.php file. Along with this, corresponding migration and draft files were created under the fixtures directory. This update aids in handling scenarios with ULID that do not have any specified relationships.
'ulidMorphs' was added to the test fixtures in all-column-types for drafts, models, and factories.
Foreign key constraints updated in model test fixtures and new foreign keys 'customer_id' and 'tran_id' added. Migration Generator has been modified to handle ULID datatype along with ID and UUID. This commit adapts the Migration Generator to recognize and handle the ULID datatype and updates tests to reflect this change.
A new function, `it_parses_ulid_shorthand`, is added to BlueprintTest to ensure correct parsing of ULID shorthand. Accordingly, assertions have also been updated to reflect this new generation method in the relevant test fixtures and new keys handling.
The `nullableUlidMorphs` and `ulidMorphs` column types have been added to the `all-column-types` test fixtures and model generator. The appropriate handling for these new column types were added to the `ModelGenerator` PHP class. This addition ensures that these column types are properly processed and reflected in the models.
Added a function to check if ULIDs are used in the 'Model' class. Expanded 'ModelGenerator' class to act accordingly if ULIDs are used. Added respective test case and fixture files to ensure correct functionality.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.