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
772 B
37 lines
772 B
8 years ago
|
<?php
|
||
|
|
||
|
return <<<CODE
|
||
|
<?php
|
||
|
|
||
|
use yii\db\Migration;
|
||
|
|
||
|
/**
|
||
|
* Handles dropping columns from table `test`.
|
||
|
*/
|
||
|
class {$class} extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
\$this->dropColumn('test', 'title');
|
||
|
\$this->dropColumn('test', 'body');
|
||
|
\$this->dropColumn('test', 'price');
|
||
|
\$this->dropColumn('test', 'created_at');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
\$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());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
CODE;
|