ForestAdmin / forest-laravel

🌱 Laravel Liana for Forest Admin. This repo is no longer maintained. Please use laravel-forestadmin instead: https://github.com/ForestAdmin/laravel-forestadmin
GNU General Public License v3.0
4 stars 0 forks source link

Unknown database type json requested #40

Closed saqueib closed 2 years ago

saqueib commented 7 years ago

I have some json field type on Models and when I ran php artisan forest:send-apimap I got this error

string(205) "...../vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php423:
Unknown database type json requested, 
Doctrine\DBAL\Platforms\MySQL57Platform may not support it."

Is forest don't support json type fields?

Migration with json field

$table->json('media')->nullable();

please help, I am using Laravel 5.3 with MySql 5.7.1

arnaudbesnier commented 7 years ago

Hi @saqueib thanks for the report, we'll take time to fix this issue next week.

arnaudbesnier commented 7 years ago

I just tried to setup a JSON field on a test project. I can reproduce the issue using a MySql database (everything works fine using a Postgresql database).

I need to find a solution to fix this now.

arnaudbesnier commented 7 years ago

The error is raised by the Doctrine method called here: https://github.com/ForestAdmin/forest-laravel/blob/devel/src/Bootstraper.php#L81

nkconnor commented 7 years ago

registering the type json as 'string' with doctrine worked for me:

@@ -81,6 +82,8 @@ class Bootstraper {
         $schema = $model->getConnection()->getDoctrineSchemaManager($table);
         $databasePlatform = $schema->getDatabasePlatform();
         $databasePlatform->registerDoctrineTypeMapping('enum', 'string');
+        $databasePlatform->registerDoctrineTypeMapping('json', 'string');
hermanschutte commented 6 years ago

@arnaudbesnier any update on this fix?

arnaudbesnier commented 2 years ago

Hi @saqueib, @nkconnor, @hermanschutte,

This issue will be closed as the repository will be archived soon.

The brand new Laravel agent for Forest Admin is available here: https://github.com/ForestAdmin/laravel-forestadmin

As we now have a team of dedicated developers for this new Laravel agent, be sure Forest Admin will provide a much better Laravel support experience compared to the one you had in the past for v1.

Forest Admin also evolved a lot in 4 years as an internal tool platform, don’t hesitate to give it another try, you should not be disappointed 🌲🌲🌲

Best Regards.