* Configuration > Plan Settings (parameter plan_objective_types). Adds plan_objectives.type for * installs created before 0.10.0. The column is nullable: existing objectives have no type yet, and * each one must be given a type before the plan can be saved again (validation requires it). Runs only * when the column is missing. */ class Version_0_10_0 extends AbstractMigration { protected function isApplicable(Schema $schema): bool { $objectives = $this->concatPrefix(PlanObjective::TABLE_NAME); if (!$schema->hasTable($objectives)) { return false; } return !$schema->getTable($objectives)->hasColumn('type'); } protected function up(): void { $objectives = $this->concatPrefix(PlanObjective::TABLE_NAME); $table = $this->entityManager->getConnection()->createSchemaManager()->introspectTable($objectives); if (!$table->hasColumn('type')) { $this->addSql(sprintf('ALTER TABLE %s ADD type VARCHAR(%d) DEFAULT NULL', $objectives, PlanObjective::TYPE_MAX_LENGTH)); } } }