diff options
Diffstat (limited to 'vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php')
| -rw-r--r-- | vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php b/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php new file mode 100644 index 0000000..840ff57 --- /dev/null +++ b/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\DBAL\Platforms; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Platforms\Keywords\KeywordList; | ||
| 8 | use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords; | ||
| 9 | use Doctrine\DBAL\Schema\Index; | ||
| 10 | use Doctrine\DBAL\Types\BlobType; | ||
| 11 | use Doctrine\DBAL\Types\TextType; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * Provides the behavior, features and SQL dialect of the Oracle MySQL database platform | ||
| 15 | * of the oldest supported version. | ||
| 16 | */ | ||
| 17 | class MySQLPlatform extends AbstractMySQLPlatform | ||
| 18 | { | ||
| 19 | /** | ||
| 20 | * {@inheritDoc} | ||
| 21 | * | ||
| 22 | * Oracle MySQL does not support default values on TEXT/BLOB columns until 8.0.13. | ||
| 23 | * | ||
| 24 | * @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy. | ||
| 25 | * | ||
| 26 | * @link https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-data-types | ||
| 27 | */ | ||
| 28 | public function getDefaultValueDeclarationSQL(array $column): string | ||
| 29 | { | ||
| 30 | if ($column['type'] instanceof TextType || $column['type'] instanceof BlobType) { | ||
| 31 | unset($column['default']); | ||
| 32 | } | ||
| 33 | |||
| 34 | return parent::getDefaultValueDeclarationSQL($column); | ||
| 35 | } | ||
| 36 | |||
| 37 | /** | ||
| 38 | * {@inheritDoc} | ||
| 39 | */ | ||
| 40 | protected function getRenameIndexSQL(string $oldIndexName, Index $index, string $tableName): array | ||
| 41 | { | ||
| 42 | return ['ALTER TABLE ' . $tableName . ' RENAME INDEX ' . $oldIndexName . ' TO ' . $index->getQuotedName($this)]; | ||
| 43 | } | ||
| 44 | |||
| 45 | protected function createReservedKeywordsList(): KeywordList | ||
| 46 | { | ||
| 47 | return new MySQLKeywords(); | ||
| 48 | } | ||
| 49 | } | ||
