MohmmedAshraf / laravel-translations

Laravel Translations UI package provides a user-friendly interface for managing translations in your Laravel application. It simplifies tasks such as adding, editing, deleting, and exporting translations. The package also includes a handy search feature and the ability to invite collaborators for easy translation management
MIT License
648 stars 91 forks source link

sync uuid creation column with the new upgrade #130

Open benounnas opened 2 months ago

benounnas commented 2 months ago

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

Testing

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]