getTable('visits'); $this->skipIf($visits->hasIndex(self::INDEX_NAME)); $visits->addIndex(['date'], self::INDEX_NAME); } public function down(Schema $schema): void { $visits = $schema->getTable('visits'); $this->skipIf(! $visits->hasIndex(self::INDEX_NAME)); $visits->dropIndex(self::INDEX_NAME); } }