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

Feature/add ulid column type #3

Merged
merged 13 commits into from
Dec 9, 2023
Merged

Conversation

rcrosbourne
Copy link
Owner

No description provided.

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.
@rcrosbourne rcrosbourne merged commit 2226e6a into master Dec 9, 2023
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.

1 participant