Skip to content

Commit a52e714

Browse files
committed
Fix serialisation of unique index type name (UNIQUE KEY)
1 parent 7055059 commit a52e714

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sources/Sql/Ddl/Table/Index/IndexType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class IndexType extends SqlEnum
1919
{
2020

2121
public const PRIMARY = Keyword::PRIMARY . ' ' . Keyword::KEY;
22-
public const UNIQUE = Keyword::UNIQUE . ' ' . Keyword::KEY; // or INDEX
22+
public const UNIQUE = Keyword::UNIQUE . ' ' . Keyword::INDEX;
2323
public const INDEX = Keyword::INDEX; // or KEY
2424
public const FULLTEXT = Keyword::FULLTEXT . ' ' . Keyword::INDEX; // or KEY
2525
public const SPATIAL = Keyword::SPATIAL . ' ' . Keyword::INDEX; // or KEY
@@ -28,12 +28,12 @@ protected static function validateValue(string &$value): bool
2828
{
2929
// normalize KEY vs INDEX
3030
$value = strtoupper($value);
31-
if ($value === Keyword::UNIQUE . ' ' . Keyword::INDEX) {
31+
if ($value === Keyword::UNIQUE . ' ' . Keyword::KEY) {
3232
$value = self::UNIQUE;
3333
} elseif ($value === Keyword::FULLTEXT . ' ' . Keyword::KEY) {
3434
$value = self::FULLTEXT;
3535
} elseif ($value === Keyword::SPATIAL . ' ' . Keyword::KEY) {
36-
$value = self::FULLTEXT;
36+
$value = self::SPATIAL;
3737
} elseif ($value === Keyword::KEY) {
3838
$value = self::INDEX;
3939
}

0 commit comments

Comments
 (0)