[ 'referer', 'user_agent', ], 'visit_locations' => [ 'timezone', 'country_code', 'country_name', 'region_name', 'city_name', ], ]; public function up(Schema $schema): void { each( self::COLUMN_DEFAULTS_MAP, fn (array $columns, string $tableName) => each($columns, partial_left([$this, 'setDefaultValueForColumnInTable'], $tableName)), ); } public function setDefaultValueForColumnInTable(string $tableName, string $columnName): void { $qb = $this->connection->createQueryBuilder(); $qb->update($tableName) ->set($columnName, ':emptyValue') ->setParameter('emptyValue', self::DEFAULT_EMPTY_VALUE) ->where($qb->expr()->isNull($columnName)) ->execute(); } public function down(Schema $schema): void { // No need (and no way) to undo this migration } /** * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104 */ public function isTransactional(): bool { return false; } }