db->schema->getTableSchema('{{%portal_database_version}}'); $column = 'subversion' . ($i + 1); if (isset($table->columns[$column])) { $subversions['subversion' . ($i + 1)] = $exploded[$i]; } } $this->insert('{{%portal_database_version}}', ArrayHelper::merge([ 'version' => $version, 'created_at' => $time, 'updated_at' => $time, ], $subversions)); } public function insertCurrent() { $this->insertRow($this->version); } public function up() { $this->insertCurrent(); if (\Yii::$app && \Yii::$app->cache) { \Yii::$app->cache->flush(); } } public function down() { return true; } }