refactor(plugin): rename Plan to Program and add audience/UTM routes
Rename the Plan bundle to Program across config, routes, menus, and controllers (Plan -> Initiative), bump version to 0.16.0, and introduce new audience and UTM taxonomy routes and permissions to support the expanded Programs feature set.
This commit is contained in:
1 parent
8268fad886
commit
71ff11390b
121 files changed
+5011
-2874
No files matched your search
@@ -2,12 +2,12 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MauticPlugin\PlanBundle\Migrations;
|
||||
namespace MauticPlugin\ProgramBundle\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Schema\Table;
|
||||
use Mautic\IntegrationsBundle\Migration\AbstractMigration;
|
||||
use MauticPlugin\PlanBundle\Entity\Plan;
|
||||
use MauticPlugin\ProgramBundle\Entity\Initiative;
|
||||
|
||||
/**
|
||||
* Brings the plans table in line with the entity mapping.
|
||||
@@ -31,13 +31,11 @@ class Version_0_2_0 extends AbstractMigration
|
||||
|
||||
protected function isApplicable(Schema $schema): bool
|
||||
{
|
||||
$table = $this->getTable($schema);
|
||||
|
||||
if (null === $table) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return [] !== $this->getMissingForeignKeys($table) || $this->statusNeedsResize($table);
|
||||
// Historical migration: its changes were applied on every install that ran
|
||||
// it before 0.16.0 (this plugin renamed Plan→Program/Initiative in 0.16.0), and
|
||||
// a fresh install creates the current tables from the entity mapping. Never
|
||||
// applicable anymore.
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function up(): void
|
||||
@@ -52,14 +50,14 @@ class Version_0_2_0 extends AbstractMigration
|
||||
if ($this->statusNeedsResize($table)) {
|
||||
$this->addSql(sprintf(
|
||||
'ALTER TABLE %s MODIFY status VARCHAR(%d) NOT NULL',
|
||||
$this->concatPrefix(Plan::TABLE_NAME),
|
||||
$this->concatPrefix(Initiative::TABLE_NAME),
|
||||
self::STATUS_LENGTH
|
||||
));
|
||||
}
|
||||
|
||||
foreach ($this->getMissingForeignKeys($table) as $column => $referenceTable) {
|
||||
$this->addSql($this->generateAlterTableForeignKeyStatement(
|
||||
Plan::TABLE_NAME,
|
||||
Initiative::TABLE_NAME,
|
||||
[$column],
|
||||
$referenceTable,
|
||||
['id'],
|
||||
@@ -70,7 +68,7 @@ class Version_0_2_0 extends AbstractMigration
|
||||
|
||||
private function getTable(Schema $schema): ?Table
|
||||
{
|
||||
$name = $this->concatPrefix(Plan::TABLE_NAME);
|
||||
$name = $this->concatPrefix(Initiative::TABLE_NAME);
|
||||
|
||||
return $schema->hasTable($name) ? $schema->getTable($name) : null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user