From cdf52e4bcc3a43f545972ea9aebe6e2237278893 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sat, 14 May 2022 12:40:05 -0700 Subject: [PATCH] Remove hard-coded string column length --- dbal.sqlite | Bin 0 -> 8192 bytes src/Platforms/SqlitePlatform.php | 3 --- tests/Platforms/SqlitePlatformTest.php | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 dbal.sqlite diff --git a/dbal.sqlite b/dbal.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d98b90de23a8f5581f4ed6ba5d454a6a16e37c6f GIT binary patch literal 8192 zcmeI#u?oU45C-5&6@-H5*7ZgOaq$I=rQi@Mrq$VsQ3`6IjSt}a_>d;0gNwM!|C8h{ zA=9^AwpFDye6H$SVR=Dg5`vb@L=<$}l{Ws~?|NUvNB^x2Xr3L0{`2TXZXpnW00bZa z0SG_<0uX=z1Rwwb2>cMxVh}}ZUz{SSK=1IF~DxaQhTaLUt)nT;8p@ zm^z%f8NcGa)bUzsPB%HHJEf+6Hg`im0s#m>00Izz00bZa0SG_<0uX?}9}Bzz_^%*c literal 0 HcmV?d00001 diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php index 84d701421b0..60393071e18 100644 --- a/src/Platforms/SqlitePlatform.php +++ b/src/Platforms/SqlitePlatform.php @@ -848,9 +848,6 @@ private function getSimpleAlterTableSQL(TableDiff $diff): array|false } $definition['name'] = $column->getQuotedName($this); - if ($type instanceof Types\StringType && $definition['length'] === null) { - $definition['length'] = 255; - } $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' ADD COLUMN ' . $this->getColumnDeclarationSQL($definition['name'], $definition); diff --git a/tests/Platforms/SqlitePlatformTest.php b/tests/Platforms/SqlitePlatformTest.php index 2b208f2c186..d13574b728d 100644 --- a/tests/Platforms/SqlitePlatformTest.php +++ b/tests/Platforms/SqlitePlatformTest.php @@ -309,7 +309,7 @@ public function testAlterTableAddColumns(): void ]); $expected = [ - 'ALTER TABLE user ADD COLUMN foo VARCHAR(255) NOT NULL', + 'ALTER TABLE user ADD COLUMN foo VARCHAR NOT NULL', 'ALTER TABLE user ADD COLUMN count INTEGER DEFAULT 1', ];