yii2-schemadump
yii2-schemadump copied to clipboard
Sets are created as string(0)
Hey there, I found a bug: If I dump a schema containing a set this set is represented as string with length 0.
So in code
set('MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY','SUNDAY') NOT NULL
becomes
$this->string(0)->notNull(),
But overall nice and handy extension, keep up the good work
I'm using MySQL as database.
Implementation is difficult because the SET type of MySQL is not supported by Yii core. However, enum type is supported.
I know, I tried to add it like 'col_name' => $this->set(["mon","tue",...])
with no success and resorted to 'col_name' => 'set("mon","tue",...)'
which seems to work.
I will make a PR proposing this change.
(Re-commented to enable markup support.)
Update Real-life got me hard the last few weeks. The PR will take some time (or someone else grabs it)