Yii2 framework backup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
768 B

<?php
return <<<CODE
<?php
use yii\db\Migration;
/**
* Handles adding columns to table `test`.
*/
class {$class} extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
\$this->addColumn('test', 'title', \$this->string(10)->notNull());
\$this->addColumn('test', 'body', \$this->text()->notNull());
\$this->addColumn('test', 'price', \$this->money(11,2)->notNull());
\$this->addColumn('test', 'created_at', \$this->dateTime());
}
/**
* @inheritdoc
*/
public function down()
{
\$this->dropColumn('test', 'title');
\$this->dropColumn('test', 'body');
\$this->dropColumn('test', 'price');
\$this->dropColumn('test', 'created_at');
}
}
CODE;