nkovacs / yii2-mysql
Replacement MySQL Schema for Yii 2 with fixes
Installs: 6 562
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-25 03:07:21 UTC
README
Replacement MySQL Schema for Yii 2 with fixes.
Currently the only change is that Schema::TYPE_TEXT
defaults to 'mediumtext'. This can be changed by
setting the defaultTextType
property of the Schema.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist nkovacs/yii2-mysql "*"
or add
"nkovacs/yii2-mysql": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, add the following to your configuration file to overwrite the default mysql schema :
Yii::$container->set('yii\db\mysql\Schema', 'nkovacs\mysql\Schema');
To change options :
Yii::$container->set('yii\db\mysql\Schema', [ 'class' => 'nkovacs\mysql\Schema', 'defaultTextType' => 'longtext', ]);