Files
yii2/tests/data/console/migrate_create/create_fields.php
Angel Guevara fdbf7d85a1 Simple tests (#11606)
* method to simplify migrate/create tests
* use new assertion for all migration/create tests
* move the expected files to test/data/console
2016-05-24 09:35:23 +03:00

36 lines
610 B
PHP

<?php
return <<<CODE
<?php
use yii\db\Migration;
/**
* Handles the creation for 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;