From 0d1e885f93bb4ae8018c6c800031f5a7d5283d31 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 --- src/Platforms/SqlitePlatform.php | 3 --- tests/Platforms/SqlitePlatformTest.php | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) 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', ];