Skip to content

Commit e6dfb3d

Browse files
committed
bug symfony#61585 [HttpFoundation][SQLSRV] Change column type from TEXT to STRING (Matt-PMCT)
This PR was submitted for the 7.4 branch but it was merged into the 6.4 branch instead. Discussion ---------- [HttpFoundation][SQLSRV] Change column type from `TEXT` to `STRING` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | None | License | MIT Using TEXT for the id column results in Doctrine setting the SQL column to VARCHAR(MAX) for SQL Server, which results in an SQL error since the primary key cannot be VARCHAR(MAX). This change enables Doctrine to recognize the length setting, which would otherwise be ignored for TEXT objects. This was described by the Doctrine Team here (doctrine/dbal#7126) Commits ------- 8dcddb0 SQLSRV: Change column type from TEXT to STRING
2 parents bbfcf84 + 8dcddb0 commit e6dfb3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function configureSchema(Schema $schema, ?\Closure $isSameDatabase = null
216216
$table->addColumn($this->timeCol, Types::INTEGER)->setNotnull(true);
217217
break;
218218
case 'sqlsrv':
219-
$table->addColumn($this->idCol, Types::TEXT)->setLength(128)->setNotnull(true);
219+
$table->addColumn($this->idCol, Types::STRING)->setLength(128)->setNotnull(true);
220220
$table->addColumn($this->dataCol, Types::BLOB)->setNotnull(true);
221221
$table->addColumn($this->lifetimeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true);
222222
$table->addColumn($this->timeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true);

0 commit comments

Comments
 (0)