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

sync uuid creation column with the new upgrade #130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benounnas
Copy link

Fix UUID column type for MariaDB compatibility

Problem

When using MariaDB as the database driver for Laravel Translations UI, the migration fails due to an incompatibility with the uuid column type. This occurs because MariaDB doesn't natively support the uuid data type.

Error

Running the migration 2024_09_05_100938_create_phrases_table results in the following error:

SQLSTATE[HY000]: General error: 4161 Unknown data type: 'uuid'

Solution

Update the migration file to use char(36) instead of uuid() for MariaDB compatibility. This change aligns with Laravel's recommendation for handling UUIDs in MariaDB as mentioned in the upgrade guide.

Changes

In the migration file create_phrases_table, replace:

$table->uuid();

with:

$table->char('uuid', 36);

Benefits

  • Ensures compatibility with MariaDB while maintaining UUID functionality
  • Follows Laravel's recommended approach for handling UUIDs in MariaDB environments
  • Allows successful migration and installation of Laravel Translations UI with MariaDB

Testing

  • Tested with MariaDB to ensure successful migration
  • Verified UUID generation and storage work as expected
  • Tested with other supported databases to ensure no regression

Additional Notes

This change is specific to MariaDB compatibility and should not affect the functionality of the package when used with other database systems that support the native uuid() method.


Closes #[Issue Number]

@MohmmedAshraf MohmmedAshraf force-pushed the main branch 2 times, most recently from 9f04f9b to 4db0efb Compare October 14, 2024 11:40
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