Skip to content

Commit

Permalink
Merge pull request SimpleMachines#8127 from dragomano/mediumtext_larg…
Browse files Browse the repository at this point in the history
…etext
  • Loading branch information
Sesquipedalian committed Mar 8, 2024
2 parents c0b01e6 + e4d22ba commit a371bbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Sources/Db/APIs/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ public function add_index(string $table_name, array $index_info, array $paramete
// If a size was already specified, we won't be able to match it anyways.
if (
!isset($cols[$c])
|| !in_array($cols[$c]['type'], ['text', 'mediumntext', 'largetext', 'varchar', 'char'])
|| !in_array($cols[$c]['type'], ['text', 'mediumtext', 'longtext', 'varchar', 'char'])
|| (
isset($size)
&& $size <= 191
Expand Down Expand Up @@ -1573,7 +1573,7 @@ public function create_table(string $table_name, array $columns, array $indexes
if (
$key === false
|| !isset($columns[$key])
|| !in_array($columns[$key]['type'], ['text', 'mediumntext', 'largetext', 'varchar', 'char'])
|| !in_array($columns[$key]['type'], ['text', 'mediumtext', 'longtext', 'varchar', 'char'])
|| (
isset($size)
&& $size <= 191
Expand Down Expand Up @@ -2383,7 +2383,7 @@ protected function create_query_column(array $column): string
// Allow unsigned integers (mysql only)
$unsigned = in_array($type, ['int', 'tinyint', 'smallint', 'mediumint', 'bigint']) && !empty($column['unsigned']) ? 'unsigned ' : '';

if ($size !== null) {
if ($size > 0) {
$type = $type . '(' . $size . ')';
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Db/APIs/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ public function calculate_type(string $type_name, ?int $type_size = null, bool $
'tinyint' => 'smallint',
'tinytext' => 'character varying',
'mediumtext' => 'text',
'largetext' => 'text',
'longtext' => 'text',
'inet' => 'inet',
'time' => 'time without time zone',
'datetime' => 'timestamp without time zone',
Expand Down

0 comments on commit a371bbf

Please sign in to comment.