clearTable($table_name) . '_archive'; } public function up() { foreach ($this->tables as $table) { $table_schema = Yii::$app->db->schema->getTableSchema($table); if (isset($table_schema->columns['archive'])) { try { $this->createIndex($this->getIndexName($table), $table, 'archive'); } catch (\Throwable $ex) { } } } } public function down() { foreach ($this->tables as $table) { try { $this->dropIndex($this->getIndexName($table), $table); } catch (\Throwable $e) { } } } }