Skip to content

Commit

Permalink
Merge pull request #5393 from morozov/remove-sqlite-string-length
Browse files Browse the repository at this point in the history
Remove hard-coded string column length
  • Loading branch information
morozov authored May 14, 2022
2 parents e8ed43b + 0d1e885 commit d40bde4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/Platforms/SqlitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/Platforms/SqlitePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

Expand Down

0 comments on commit d40bde4

Please sign in to comment.