hasTable('circles_membership')) { $table = $schema->getTable('circles_membership'); if (!$table->hasPrimaryKey()) { $indexes = $table->getIndexes(); // conflict in Oracle with existing unique index, duplicate of primaryKey. foreach ($indexes as $index) { if ($index->isUnique()) { $table->dropIndex($index->getName()); } } $table->setPrimaryKey(['single_id', 'circle_id']); } } return $schema; } }