db = ParentModule::getDb(); parent::init(); } protected $table = '{{%location_region}}'; /** * @inheritdoc */ public function safeUp() { $this->createTable($this->table, [ 'id' => $this->primaryKey()->unsigned()->comment('Id'), 'position' => $this->integer(10)->notNull()->defaultValue(0)->comment('position'), 'created_at' => $this->integer(10)->notNull()->defaultValue(0)->comment('Create time'), 'updated_at' => $this->integer(10)->notNull()->defaultValue(0)->comment('Update time'), 'published' => $this->boolean()->notNull()->defaultValue(0)->comment('Published'), 'deleted' => $this->boolean()->notNull()->defaultValue(0)->comment('Deleted'), ]); } /** * @inheritdoc */ public function safeDown() { $this->dropTable($this->table); } }