skiptirengu/yii2-mssql-schema

nvarchar returning incorrect length returned when using Gii

Opened this issue · 0 comments

Using v0.6

I really appreciate you writing this package. I have been using it for a few years now.

I noticed recently when using Gii to generate a model that the length of a rule is not correct if the column type is nvarchar.

Migration to add the table
$this->createTable('backgroundImage', [ 'id' => $this->primaryKey(), 'guid' => $this->string(50)->notNull(), 'fileId' => $this->integer()->notNull() ]);

See the length of "guid" is 50.

Then when I use Gii to generate the model.
[['guid'], 'string', 'max' => 100],

I am expecting it to be 50 not 100.

Thanks again for your efforts!