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

Enum support #3

Open
usernotnull opened this issue Aug 12, 2021 · 3 comments
Open

Enum support #3

usernotnull opened this issue Aug 12, 2021 · 3 comments

Comments

@usernotnull
Copy link

Some of my models have enum fields.

This causes typescript:generate to throw:

Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

  at ___\vendor\doctrine\dbal\src\Platforms\AbstractPlatform.php:398

I'm not sure why it's not supported, as enums are working fine on my project/setup.

@lepikhinb
Copy link
Owner

Enums aren't supported by DBAL, which is used for the columns analysis. I'm going to make a driver for it.

@CaReS0107
Copy link

Schema::getConnection()
->getDoctrineSchemaManager()
->getDatabasePlatform()
->registerDoctrineTypeMapping('enum', 'string');

        In some of your provider

@rkrater
Copy link

rkrater commented Nov 30, 2023

In some of your provider

Put this in the Model's class or in boot of AppServiceProvider?

Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');

Also, getting Method 'getDatabasePlatform' is deprecated

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

No branches or pull requests

4 participants