Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Mautic\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Mautic\CoreBundle\Doctrine\PreUpAssertionMigration;
use Mautic\LeadBundle\Field\Helper\IndexHelper;
final class Version20211020092759 extends PreUpAssertionMigration
{
private const TABLE = 'leads';
protected function preUpAssertions(): void
{
$this->skipAssertion(
function (Schema $schema) {
$table = $schema->getTable($this->getPrefixedTableName(self::TABLE));
return count($table->getIndexes()) >= IndexHelper::MAX_COUNT_ALLOWED || $table->hasIndex($this->getIndexName());
},
"Index {$this->getIndexName()} cannot be created because the {$this->getPrefixedTableName(self::TABLE)} has hit the table index limit or the index already exists"
);
}
public function up(Schema $schema): void
{
$this->addSql("CREATE INDEX {$this->getIndexName()} ON {$this->getPrefixedTableName(self::TABLE)} (date_modified)");
}
private function getIndexName(): string
{
return $this->prefix.'lead_date_modified';
}
}