Closed skeets23 closed 4 years ago
Thanks for this.
Before it can be merged, can you match the PSR-2 coding style. Also, the Enum class seems unnecessary. Please inline it to keep everything within the current class.
Ok, I've fixed the indenting and replaced FCN with imports. (I'm assuming that's what you were referring to?)
Unfortunately, the Enum class can't be removed. MySql enum
fields are not supported by the DBAL
library at all, and so to allow them, a custom data type must be used.
I followed the official documentation to add this custom type:
Enum's aren't supported in DBAL, but for our purposes here, a custom class that is there just to add an additional type to DBAL so we can differentiate between enum
and string
is enough to do what we're looking for.
If there's another way to do it, I'd be glad to hear about it. 😅
You'll see the CustomEnum
class is mentioned on line 76 of GenerateCommand.php
Thanks for the code review. I've made the changes and it should be ready to go now. 👍
Thanks. I'll merge this and tag it this week.
Instead of just mapping enum type fields to act as "string", I created a custom type. This way a MySQL field like this:
will produce a factory like this: