nyx-solutions / yii2-nyx-migration
Yii2 扩展迁移工具包
5.0.1
2022-06-02 14:32 UTC
Requires
- php: >=8.1.0 <8.2
- nyx-solutions/yii2-nyx: ~5.0.0
- nyx-solutions/yii2-nyx-helpers: ~5.0.0
README
Yii2 NYX Migration 是一个为 Yii2 提供迁移方法的库。
安装
安装此扩展的首选方式是通过 composer。
可以运行
php composer.phar require --prefer-dist nyx-solutions/yii2-nyx-migration "*"
或者添加
"nyx-solutions/yii2-nyx-migration": "*"
到您的 composer.json
文件的 require 部分。
用法
use nyx\db\Migration; class m150409_195340_site extends Migration { /** * @inheritdoc */ protected $tableName = 'site'; /** * @inheritdoc */ public function safeUp() { $columns = [ 'id' => $this->bigPrimaryKey($this->pkLength), 'name' => $this->string(2000)->notNull() ]; $this->createTable($this->getCurrentTableName(), $columns, $this->getTableOptions()); } }
许可证
yii2-nyx-migration 根据 BSD 3-Clause 许可证发布。有关详细信息,请参阅附带的 LICENSE.md
文件。