1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php use yii\db\Migration; class m160505_202248_bg extends Migration { public function up() { $this->createTable('bg', [ 'id' => $this->primaryKey(), 'title' => $this->string(250)->notNull(), 'url' => $this->string(250)->notNull(), 'image' => $this->string(250)->notNull(), ]); } public function down() { $this->dropTable('bg'); } }