PHP code example of nyx-solutions / yii2-nyx-migration
1. Go to this page and download the library: Download nyx-solutions/yii2-nyx-migration library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nyx-solutions / yii2-nyx-migration example snippets
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());
}
}