yii2-schemadump icon indicating copy to clipboard operation
yii2-schemadump copied to clipboard

Sets are created as string(0)

Open DBX12 opened this issue 6 years ago • 2 comments

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.

DBX12 avatar Apr 08 '18 12:04 DBX12

Implementation is difficult because the SET type of MySQL is not supported by Yii core. However, enum type is supported.

jamband avatar Apr 08 '18 12:04 jamband

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)

DBX12 avatar Apr 09 '18 07:04 DBX12