Files
yii2/tests/data/console/migrate_create/create_fields.php
Nikola Kovacs 84124bec4f Fix grammar in migration template docblocks. (#12148)
Fix typo in test file's name.
2016-08-12 17:55:43 +03:00

36 lines
609 B
PHP

<?php
return <<<CODE
<?php
use yii\db\Migration;
/**
* Handles the creation of table `test`.
*/
class {$class} extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
\$this->createTable('test', [
'id' => \$this->primaryKey(),
'title' => \$this->string(10)->notNull()->unique()->defaultValue("test"),
'body' => \$this->text()->notNull(),
'price' => \$this->money(11,2)->notNull(),
]);
}
/**
* @inheritdoc
*/
public function down()
{
\$this->dropTable('test');
}
}
CODE;