Base migration for Yii2
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist platx/yii2-migration "*"
or add
"platx/yii2-migration": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your migrations like this :
<?php
class m151013_132543_create_table_group extends \console\db\Migration
{
protected $_tableName = '{{%HERE_PUT_YOUR_TABLE_NAME}}';
public function safeUp()
{
$this->createTable($this->_tableName, [
'id' => $this->primaryKey(),
'name' => $this->string()->notNull(),
'slug' => $this->string()->notNull()->unique(),
...
], $this->_tableOptions);
}
}
?>
No stable releases.
Comments