concatPrefix(PlanObjective::TABLE_NAME); if (!$schema->hasTable($objectives)) { return false; } return !$schema->getTable($objectives)->hasColumn('priority'); } protected function up(): void { $objectives = $this->concatPrefix(PlanObjective::TABLE_NAME); $table = $this->entityManager->getConnection()->createSchemaManager()->introspectTable($objectives); if (!$table->hasColumn('priority')) { $this->addSql(sprintf( "ALTER TABLE %s ADD priority INT NOT NULL DEFAULT %d", $objectives, PlanObjective::PRIORITY_MIN )); } } }