platx/yii2-migration Base migration for Yii2

migrationconsoledb

Base migration

Base migration for Yii2

Installation

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.

Usage

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);
    }
}
?>

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
5 downloads in the last 30 days
2155 total downloads