Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Doctrine\DBAL\Platforms;
4
 
5
use Doctrine\DBAL\Schema\Index;
6
use Doctrine\DBAL\Schema\TableDiff;
7
use Doctrine\DBAL\SQL\Parser;
8
use Doctrine\DBAL\Types\Types;
9
use Doctrine\Deprecations\Deprecation;
10
 
11
/**
12
 * Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
13
 *
14
 * @deprecated This class will be merged with {@see MySQLPlatform} in 4.0 because support for MySQL
15
 *             releases prior to 5.7 will be dropped.
16
 */
17
class MySQL57Platform extends MySQLPlatform
18
{
19
    /**
20
     * {@inheritdoc}
21
     *
22
     * @deprecated
23
     */
24
    public function hasNativeJsonType()
25
    {
26
        Deprecation::triggerIfCalledFromOutside(
27
            'doctrine/dbal',
28
            'https://github.com/doctrine/dbal/pull/5509',
29
            '%s is deprecated.',
30
            __METHOD__,
31
        );
32
 
33
        return true;
34
    }
35
 
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getJsonTypeDeclarationSQL(array $column)
40
    {
41
        return 'JSON';
42
    }
43
 
44
    public function createSQLParser(): Parser
45
    {
46
        return new Parser(true);
47
    }
48
 
49
    /**
50
     * {@inheritdoc}
51
     */
52
    protected function getPreAlterTableRenameIndexForeignKeySQL(TableDiff $diff)
53
    {
54
        return [];
55
    }
56
 
57
    /**
58
     * {@inheritdoc}
59
     */
60
    protected function getPostAlterTableRenameIndexForeignKeySQL(TableDiff $diff)
61
    {
62
        return [];
63
    }
64
 
65
    /**
66
     * {@inheritdoc}
67
     */
68
    protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
69
    {
70
        return ['ALTER TABLE ' . $tableName . ' RENAME INDEX ' . $oldIndexName . ' TO ' . $index->getQuotedName($this)];
71
    }
72
 
73
    /**
74
     * {@inheritdoc}
75
     *
76
     * @deprecated Implement {@see createReservedKeywordsList()} instead.
77
     */
78
    protected function getReservedKeywordsClass()
79
    {
80
        Deprecation::triggerIfCalledFromOutside(
81
            'doctrine/dbal',
82
            'https://github.com/doctrine/dbal/issues/4510',
83
            'MySQL57Platform::getReservedKeywordsClass() is deprecated,'
84
                . ' use MySQL57Platform::createReservedKeywordsList() instead.',
85
        );
86
 
87
        return Keywords\MySQL57Keywords::class;
88
    }
89
 
90
    /**
91
     * {@inheritdoc}
92
     */
93
    protected function initializeDoctrineTypeMappings()
94
    {
95
        parent::initializeDoctrineTypeMappings();
96
 
97
        $this->doctrineTypeMapping['json'] = Types::JSON;
98
    }
99
}