| 
                    1
                 | 
                                    
                                                     | 
                
                 | 
                <?php  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    2
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    3
                 | 
                                    
                                                     | 
                
                 | 
                declare(strict_types=1);  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    4
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    5
                 | 
                                    
                                                     | 
                
                 | 
                namespace Doctrine\DBAL\Schema;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    6
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    7
                 | 
                                    
                                                     | 
                
                 | 
                use Doctrine\DBAL\Exception\DriverException;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    8
                 | 
                                    
                                                     | 
                
                 | 
                use Doctrine\DBAL\FetchMode;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    9
                 | 
                                    
                                                     | 
                
                 | 
                use Doctrine\DBAL\Platforms\PostgreSqlPlatform;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    10
                 | 
                                    
                                                     | 
                
                 | 
                use Doctrine\DBAL\Types\Type;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    11
                 | 
                                    
                                                     | 
                
                 | 
                use Doctrine\DBAL\Types\Types;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    12
                 | 
                                    
                                                     | 
                
                 | 
                use const CASE_LOWER;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    13
                 | 
                                    
                                                     | 
                
                 | 
                use function array_change_key_case;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    14
                 | 
                                    
                                                     | 
                
                 | 
                use function array_filter;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    15
                 | 
                                    
                                                     | 
                
                 | 
                use function array_keys;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    16
                 | 
                                    
                                                     | 
                
                 | 
                use function array_map;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    17
                 | 
                                    
                                                     | 
                
                 | 
                use function array_shift;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    18
                 | 
                                    
                                                     | 
                
                 | 
                use function assert;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    19
                 | 
                                    
                                                     | 
                
                 | 
                use function explode;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    20
                 | 
                                    
                                                     | 
                
                 | 
                use function implode;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    21
                 | 
                                    
                                                     | 
                
                 | 
                use function in_array;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    22
                 | 
                                    
                                                     | 
                
                 | 
                use function preg_match;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    23
                 | 
                                    
                                                     | 
                
                 | 
                use function sprintf;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    24
                 | 
                                    
                                                     | 
                
                 | 
                use function str_replace;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    25
                 | 
                                    
                                                     | 
                
                 | 
                use function strlen;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    26
                 | 
                                    
                                                     | 
                
                 | 
                use function strpos;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    27
                 | 
                                    
                                                     | 
                
                 | 
                use function strtolower;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    28
                 | 
                                    
                                                     | 
                
                 | 
                use function trim;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    29
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    30
                 | 
                                    
                                                     | 
                
                 | 
                /**  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    31
                 | 
                                    
                                                     | 
                
                 | 
                 * PostgreSQL Schema Manager.  | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    32
                 | 
                                    
                                                     | 
                
                 | 
                 */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    33
                 | 
                                    
                                                     | 
                
                 | 
                class PostgreSqlSchemaManager extends AbstractSchemaManager  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    34
                 | 
                                    
                                                     | 
                
                 | 
                { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    35
                 | 
                                    
                                                     | 
                
                 | 
                    /** @var array<int, string> */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    36
                 | 
                                    
                                                     | 
                
                 | 
                    private $existingSchemaPaths;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    37
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    38
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    39
                 | 
                                    
                                                     | 
                
                 | 
                     * Gets all the existing schema names.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    40
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    41
                 | 
                                    
                                                     | 
                
                 | 
                     * @return array<int, string>  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    42
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    43
                 | 
                                    
                             487                          | 
                
                 | 
                    public function getSchemaNames() : array  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    44
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    45
                 | 
                                    
                             487                          | 
                
                 | 
                        $statement = $this->_conn->executeQuery("SELECT nspname FROM pg_namespace WHERE nspname !~ '^pg_.*' AND nspname != 'information_schema'"); | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    46
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    47
                 | 
                                    
                             487                          | 
                
                 | 
                        return $statement->fetchAll(FetchMode::COLUMN);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    48
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    49
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    50
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    51
                 | 
                                    
                                                     | 
                
                 | 
                     * Returns an array of schema search paths.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    52
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    53
                 | 
                                    
                                                     | 
                
                 | 
                     * This is a PostgreSQL only function.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    54
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    55
                 | 
                                    
                                                     | 
                
                 | 
                     * @return array<int, string>  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    56
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    57
                 | 
                                    
                             487                          | 
                
                 | 
                    public function getSchemaSearchPaths() : array  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    58
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    59
                 | 
                                    
                             487                          | 
                
                 | 
                        $params = $this->_conn->getParams();  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    60
                 | 
                                    
                             487                          | 
                
                 | 
                        $schema = explode(',', $this->_conn->fetchColumn('SHOW search_path')); | 
            
                            
                    | 
                        
                     | 
                     | 
                     | 
                    
                                                                                                    
                        
                         
                                                                                        
                                                                                     
                     | 
                
            
                                                                        
                            
            
                                    
            
            
                | 
                    61
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    62
                 | 
                                    
                             487                          | 
                
                 | 
                        if (isset($params['user'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    63
                 | 
                                    
                             487                          | 
                
                 | 
                            $schema = str_replace('"$user"', $params['user'], $schema); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    64
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    65
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    66
                 | 
                                    
                             487                          | 
                
                 | 
                        return array_map('trim', $schema); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    67
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    68
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    69
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    70
                 | 
                                    
                                                     | 
                
                 | 
                     * Gets names of all existing schemas in the current users search path.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    71
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    72
                 | 
                                    
                                                     | 
                
                 | 
                     * This is a PostgreSQL only function.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    73
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    74
                 | 
                                    
                                                     | 
                
                 | 
                     * @return array<int, string>  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    75
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    76
                 | 
                                    
                             487                          | 
                
                 | 
                    public function getExistingSchemaSearchPaths() : array  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    77
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    78
                 | 
                                    
                             487                          | 
                
                 | 
                        if ($this->existingSchemaPaths === null) { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    79
                 | 
                                    
                             487                          | 
                
                 | 
                            $this->determineExistingSchemaSearchPaths();  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    80
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    81
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    82
                 | 
                                    
                             487                          | 
                
                 | 
                        return $this->existingSchemaPaths;  | 
            
            
                                                                        
                                                                
            
                                    
            
            
                | 
                    83
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    84
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    85
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    86
                 | 
                                    
                                                     | 
                
                 | 
                     * Sets or resets the order of the existing schemas in the current search path of the user.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    87
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    88
                 | 
                                    
                                                     | 
                
                 | 
                     * This is a PostgreSQL only function.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    89
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    90
                 | 
                                    
                             487                          | 
                
                 | 
                    public function determineExistingSchemaSearchPaths() : void  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    91
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    92
                 | 
                                    
                             487                          | 
                
                 | 
                        $names = $this->getSchemaNames();  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    93
                 | 
                                    
                             487                          | 
                
                 | 
                        $paths = $this->getSchemaSearchPaths();  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    94
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    95
                 | 
                                    
                                                     | 
                
                 | 
                        $this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names) : bool { | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    96
                 | 
                                    
                             487                          | 
                
                 | 
                            return in_array($v, $names);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    97
                 | 
                                    
                             487                          | 
                
                 | 
                        });  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    98
                 | 
                                    
                             487                          | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    99
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    100
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    101
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    102
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    103
                 | 
                                    
                             487                          | 
                
                 | 
                    public function dropDatabase(string $database) : void  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    104
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    105
                 | 
                                    
                                                     | 
                
                 | 
                        try { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    106
                 | 
                                    
                             487                          | 
                
                 | 
                            parent::dropDatabase($database);  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    107
                 | 
                                    
                             487                          | 
                
                 | 
                        } catch (DriverException $exception) { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    108
                 | 
                                    
                                                     | 
                
                 | 
                            // If we have a SQLSTATE 55006, the drop database operation failed  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    109
                 | 
                                    
                                                     | 
                
                 | 
                            // because of active connections on the database.  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    110
                 | 
                                    
                                                     | 
                
                 | 
                            // To force dropping the database, we first have to close all active connections  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    111
                 | 
                                    
                                                     | 
                
                 | 
                            // on that database and issue the drop database operation again.  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    112
                 | 
                                    
                             487                          | 
                
                 | 
                            if ($exception->getSQLState() !== '55006') { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    113
                 | 
                                    
                             487                          | 
                
                 | 
                                throw $exception;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    114
                 | 
                                    
                                                     | 
                
                 | 
                            }  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    115
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    116
                 | 
                                    
                             275                          | 
                
                 | 
                            assert($this->_platform instanceof PostgreSqlPlatform);  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    117
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    118
                 | 
                                    
                             275                          | 
                
                 | 
                            $this->_execSql(  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    119
                 | 
                                    
                                                     | 
                
                 | 
                                [  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    120
                 | 
                                    
                             275                          | 
                
                 | 
                                    $this->_platform->getDisallowDatabaseConnectionsSQL($database),  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    121
                 | 
                                    
                             275                          | 
                
                 | 
                                    $this->_platform->getCloseActiveDatabaseConnectionsSQL($database),  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    122
                 | 
                                    
                                                     | 
                
                 | 
                                ]  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    123
                 | 
                                    
                                                     | 
                
                 | 
                            );  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    124
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    125
                 | 
                                    
                             275                          | 
                
                 | 
                            parent::dropDatabase($database);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    126
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    127
                 | 
                                    
                             275                          | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    128
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    129
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    130
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    131
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    132
                 | 
                                    
                             382                          | 
                
                 | 
                    protected function _getPortableTableForeignKeyDefinition(array $tableForeignKey) : ForeignKeyConstraint  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    133
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    134
                 | 
                                    
                             382                          | 
                
                 | 
                        $onUpdate       = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    135
                 | 
                                    
                             382                          | 
                
                 | 
                        $onDelete       = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    136
                 | 
                                    
                             382                          | 
                
                 | 
                        $localColumns   = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    137
                 | 
                                    
                             382                          | 
                
                 | 
                        $foreignColumns = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    138
                 | 
                                    
                             382                          | 
                
                 | 
                        $foreignTable   = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    139
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    140
                 | 
                                    
                             382                          | 
                
                 | 
                        if (preg_match('(ON UPDATE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    141
                 | 
                                    
                             376                          | 
                
                 | 
                            $onUpdate = $match[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    142
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    143
                 | 
                                    
                             382                          | 
                
                 | 
                        if (preg_match('(ON DELETE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    144
                 | 
                                    
                             364                          | 
                
                 | 
                            $onDelete = $match[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    145
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    146
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    147
                 | 
                                    
                             382                          | 
                
                 | 
                        if (preg_match('/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    148
                 | 
                                    
                                                     | 
                
                 | 
                            // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    149
                 | 
                                    
                                                     | 
                
                 | 
                            // the idea to trim them here.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    150
                 | 
                                    
                             382                          | 
                
                 | 
                            $localColumns   = array_map('trim', explode(',', $values[1])); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    151
                 | 
                                    
                             382                          | 
                
                 | 
                            $foreignColumns = array_map('trim', explode(',', $values[3])); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    152
                 | 
                                    
                             382                          | 
                
                 | 
                            $foreignTable   = $values[2];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    153
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    154
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    155
                 | 
                                    
                             382                          | 
                
                 | 
                        return new ForeignKeyConstraint(  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    156
                 | 
                                    
                             382                          | 
                
                 | 
                            $localColumns,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    157
                 | 
                                    
                                                     | 
                
                 | 
                            $foreignTable,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    158
                 | 
                                    
                                                     | 
                
                 | 
                            $foreignColumns,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    159
                 | 
                                    
                             382                          | 
                
                 | 
                            $tableForeignKey['conname'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    160
                 | 
                                    
                             382                          | 
                
                 | 
                            ['onUpdate' => $onUpdate, 'onDelete' => $onDelete]  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    161
                 | 
                                    
                                                     | 
                
                 | 
                        );  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    162
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    163
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    164
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    165
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    166
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    167
                 | 
                                    
                                                     | 
                
                 | 
                    protected function _getPortableViewDefinition(array $view) : View  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    168
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    169
                 | 
                                    
                                                     | 
                
                 | 
                        return new View($view['schemaname'] . '.' . $view['viewname'], $view['definition']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    170
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    171
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    172
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    173
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    174
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    175
                 | 
                                    
                             173                          | 
                
                 | 
                    protected function _getPortableUserDefinition(array $user) : array  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    176
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    177
                 | 
                                    
                             173                          | 
                
                 | 
                        return [  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    178
                 | 
                                    
                                                     | 
                
                 | 
                            'user' => $user['usename'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    179
                 | 
                                    
                                                     | 
                
                 | 
                            'password' => $user['passwd'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    180
                 | 
                                    
                                                     | 
                
                 | 
                        ];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    181
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    182
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    183
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    184
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    185
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    186
                 | 
                                    
                                                     | 
                
                 | 
                    protected function _getPortableTableDefinition(array $table) : string  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    187
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    188
                 | 
                                    
                                                     | 
                
                 | 
                        $schemas     = $this->getExistingSchemaSearchPaths();  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    189
                 | 
                                    
                                                     | 
                
                 | 
                        $firstSchema = array_shift($schemas);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    190
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    191
                 | 
                                    
                                                     | 
                
                 | 
                        if ($table['schema_name'] === $firstSchema) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    192
                 | 
                                    
                                                     | 
                
                 | 
                            return $table['table_name'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    193
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    194
                 | 
                                    
                             487                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    195
                 | 
                                    
                                                     | 
                
                 | 
                        return $table['schema_name'] . '.' . $table['table_name'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    196
                 | 
                                    
                             487                          | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    197
                 | 
                                    
                             487                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    198
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    199
                 | 
                                    
                             487                          | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    200
                 | 
                                    
                             487                          | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    201
                 | 
                                    
                                                     | 
                
                 | 
                     * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    202
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    203
                 | 
                                    
                             382                          | 
                
                 | 
                    protected function _getPortableTableIndexesList(array $tableIndexRows, string $tableName) : array  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    204
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    205
                 | 
                                    
                                                     | 
                
                 | 
                        $buffer = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    206
                 | 
                                    
                                                     | 
                
                 | 
                        foreach ($tableIndexRows as $row) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    207
                 | 
                                    
                                                     | 
                
                 | 
                            $colNumbers    = array_map('intval', explode(' ', $row['indkey'])); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    208
                 | 
                                    
                                                     | 
                
                 | 
                            $columnNameSql = sprintf(  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    209
                 | 
                                    
                                                     | 
                
                 | 
                                'SELECT attnum, attname FROM pg_attribute WHERE attrelid=%d AND attnum IN (%s) ORDER BY attnum ASC',  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    210
                 | 
                                    
                                                     | 
                
                 | 
                                $row['indrelid'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    211
                 | 
                                    
                             445                          | 
                
                 | 
                                implode(' ,', $colNumbers) | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    212
                 | 
                                    
                                                     | 
                
                 | 
                            );  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    213
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    214
                 | 
                                    
                             445                          | 
                
                 | 
                            $stmt         = $this->_conn->executeQuery($columnNameSql);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    215
                 | 
                                    
                             406                          | 
                
                 | 
                            $indexColumns = $stmt->fetchAll();  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    216
                 | 
                                    
                             406                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    217
                 | 
                                    
                                                     | 
                
                 | 
                            // required for getting the order of the columns right.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    218
                 | 
                                    
                             406                          | 
                
                 | 
                            foreach ($colNumbers as $colNum) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    219
                 | 
                                    
                             406                          | 
                
                 | 
                                foreach ($indexColumns as $colRow) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    220
                 | 
                                    
                                                     | 
                
                 | 
                                    if ($colNum !== $colRow['attnum']) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    221
                 | 
                                    
                                                     | 
                
                 | 
                                        continue;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    222
                 | 
                                    
                             406                          | 
                
                 | 
                                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    223
                 | 
                                    
                             406                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    224
                 | 
                                    
                                                     | 
                
                 | 
                                    $buffer[] = [  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    225
                 | 
                                    
                                                     | 
                
                 | 
                                        'key_name' => $row['relname'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    226
                 | 
                                    
                             406                          | 
                
                 | 
                                        'column_name' => trim($colRow['attname']),  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    227
                 | 
                                    
                             406                          | 
                
                 | 
                                        'non_unique' => ! $row['indisunique'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    228
                 | 
                                    
                             406                          | 
                
                 | 
                                        'primary' => $row['indisprimary'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    229
                 | 
                                    
                             328                          | 
                
                 | 
                                        'where' => $row['where'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    230
                 | 
                                    
                                                     | 
                
                 | 
                                    ];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    231
                 | 
                                    
                                                     | 
                
                 | 
                                }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    232
                 | 
                                    
                             406                          | 
                
                 | 
                            }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    233
                 | 
                                    
                             406                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    234
                 | 
                                    
                             406                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    235
                 | 
                                    
                             406                          | 
                
                 | 
                        return parent::_getPortableTableIndexesList($buffer, $tableName);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    236
                 | 
                                    
                             406                          | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    237
                 | 
                                    
                             406                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    238
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    239
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    240
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    241
                 | 
                                    
                                                     | 
                
                 | 
                    protected function _getPortableDatabaseDefinition(array $database) : string  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    242
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    243
                 | 
                                    
                             445                          | 
                
                 | 
                        return $database['datname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    244
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    245
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    246
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    247
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    248
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    249
                 | 
                                    
                             275                          | 
                
                 | 
                    protected function _getPortableSequencesList(array $sequences) : array  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    250
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    251
                 | 
                                    
                             275                          | 
                
                 | 
                        $sequenceDefinitions = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    252
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    253
                 | 
                                    
                                                     | 
                
                 | 
                        foreach ($sequences as $sequence) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    254
                 | 
                                    
                                                     | 
                
                 | 
                            if ($sequence['schemaname'] !== 'public') { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    255
                 | 
                                    
                                                     | 
                
                 | 
                                $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    256
                 | 
                                    
                                                     | 
                
                 | 
                            } else { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    257
                 | 
                                    
                             269                          | 
                
                 | 
                                $sequenceName = $sequence['relname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    258
                 | 
                                    
                                                     | 
                
                 | 
                            }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    259
                 | 
                                    
                             269                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    260
                 | 
                                    
                                                     | 
                
                 | 
                            $sequenceDefinitions[$sequenceName] = $sequence;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    261
                 | 
                                    
                             269                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    262
                 | 
                                    
                             269                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    263
                 | 
                                    
                             269                          | 
                
                 | 
                        $list = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    264
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    265
                 | 
                                    
                             269                          | 
                
                 | 
                        foreach ($this->filterAssetNames(array_keys($sequenceDefinitions)) as $sequenceName) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    266
                 | 
                                    
                                                     | 
                
                 | 
                            $list[] = $this->_getPortableSequenceDefinition($sequenceDefinitions[$sequenceName]);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    267
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    268
                 | 
                                    
                             269                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    269
                 | 
                                    
                                                     | 
                
                 | 
                        return $list;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    270
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    271
                 | 
                                    
                             269                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    272
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    273
                 | 
                                    
                             269                          | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    274
                 | 
                                    
                             269                          | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    275
                 | 
                                    
                                                     | 
                
                 | 
                    protected function getPortableNamespaceDefinition(array $namespace) : string  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    276
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    277
                 | 
                                    
                             269                          | 
                
                 | 
                        return $namespace['nspname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    278
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    279
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    280
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    281
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    282
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    283
                 | 
                                    
                             251                          | 
                
                 | 
                    protected function _getPortableSequenceDefinition(array $sequence) : Sequence  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    284
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    285
                 | 
                                    
                             251                          | 
                
                 | 
                        if ($sequence['schemaname'] !== 'public') { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    286
                 | 
                                    
                                                     | 
                
                 | 
                            $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    287
                 | 
                                    
                                                     | 
                
                 | 
                        } else { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    288
                 | 
                                    
                                                     | 
                
                 | 
                            $sequenceName = $sequence['relname'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    289
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    290
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    291
                 | 
                                    
                             269                          | 
                
                 | 
                        if (! isset($sequence['increment_by'], $sequence['min_value'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    292
                 | 
                                    
                                                     | 
                
                 | 
                            /** @var string[] $data */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    293
                 | 
                                    
                             269                          | 
                
                 | 
                            $data = $this->_conn->fetchAssoc('SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName)); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    294
                 | 
                                    
                             269                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    295
                 | 
                                    
                                                     | 
                
                 | 
                            $sequence += $data;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    296
                 | 
                                    
                             269                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    297
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    298
                 | 
                                    
                                                     | 
                
                 | 
                        return new Sequence($sequenceName, (int) $sequence['increment_by'], (int) $sequence['min_value']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    299
                 | 
                                    
                             269                          | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    300
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    301
                 | 
                                    
                             179                          | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    302
                 | 
                                    
                                                     | 
                
                 | 
                     * {@inheritdoc} | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    303
                 | 
                                    
                             179                          | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    304
                 | 
                                    
                                                     | 
                
                 | 
                    protected function _getPortableTableColumnDefinition(array $tableColumn) : Column  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    305
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    306
                 | 
                                    
                             269                          | 
                
                 | 
                        $tableColumn = array_change_key_case($tableColumn, CASE_LOWER);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    307
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    308
                 | 
                                    
                                                     | 
                
                 | 
                        $length = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    309
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    310
                 | 
                                    
                                                     | 
                
                 | 
                        if (in_array(strtolower($tableColumn['type']), ['varchar', 'bpchar'], true)  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    311
                 | 
                                    
                                                     | 
                
                 | 
                            && preg_match('/\((\d*)\)/', $tableColumn['complete_type'], $matches)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    312
                 | 
                                    
                             445                          | 
                
                 | 
                            $length = (int) $matches[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    313
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    314
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    315
                 | 
                                    
                                                     | 
                
                 | 
                        $matches = [];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    316
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    317
                 | 
                                    
                                                     | 
                
                 | 
                        $autoincrement = false;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    318
                 | 
                                    
                             445                          | 
                
                 | 
                        if ($tableColumn['default'] !== null && preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    319
                 | 
                                    
                             445                          | 
                
                 | 
                            $tableColumn['sequence'] = $matches[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    320
                 | 
                                    
                             433                          | 
                
                 | 
                            $tableColumn['default']  = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    321
                 | 
                                    
                                                     | 
                
                 | 
                            $autoincrement           = true;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    322
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    323
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    324
                 | 
                                    
                                                     | 
                
                 | 
                        if ($tableColumn['default'] !== null) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    325
                 | 
                                    
                             445                          | 
                
                 | 
                            if (preg_match("/^['(](.*)[')]::/", $tableColumn['default'], $matches)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    326
                 | 
                                    
                             445                          | 
                
                 | 
                                $tableColumn['default'] = $matches[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    327
                 | 
                                    
                             400                          | 
                
                 | 
                            } elseif (preg_match('/^NULL::/', $tableColumn['default'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    328
                 | 
                                    
                             400                          | 
                
                 | 
                                $tableColumn['default'] = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    329
                 | 
                                    
                             400                          | 
                
                 | 
                            }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    330
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    331
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    332
                 | 
                                    
                             445                          | 
                
                 | 
                        if ($length === -1 && isset($tableColumn['atttypmod'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    333
                 | 
                                    
                             445                          | 
                
                 | 
                            $length = $tableColumn['atttypmod'] - 4;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    334
                 | 
                                    
                             433                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    335
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    336
                 | 
                                    
                             433                          | 
                
                 | 
                        if ((int) $length <= 0) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    337
                 | 
                                    
                                                     | 
                
                 | 
                            $length = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    338
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    339
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    340
                 | 
                                    
                             445                          | 
                
                 | 
                        $fixed = false;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    341
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    342
                 | 
                                    
                                                     | 
                
                 | 
                        if (! isset($tableColumn['name'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    343
                 | 
                                    
                                                     | 
                
                 | 
                            $tableColumn['name'] = '';  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    344
                 | 
                                    
                             445                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    345
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    346
                 | 
                                    
                                                     | 
                
                 | 
                        $precision = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    347
                 | 
                                    
                                                     | 
                
                 | 
                        $scale     = 0;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    348
                 | 
                                    
                             445                          | 
                
                 | 
                        $jsonb     = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    349
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    350
                 | 
                                    
                             445                          | 
                
                 | 
                        $dbType = strtolower($tableColumn['type']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    351
                 | 
                                    
                             445                          | 
                
                 | 
                        if ($tableColumn['domain_type'] !== null  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    352
                 | 
                                    
                                                     | 
                
                 | 
                            && strlen($tableColumn['domain_type'])  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    353
                 | 
                                    
                                                     | 
                
                 | 
                            && ! $this->_platform->hasDoctrineTypeMappingFor($tableColumn['type'])  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    354
                 | 
                                    
                             445                          | 
                
                 | 
                        ) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    355
                 | 
                                    
                             445                          | 
                
                 | 
                            $dbType                       = strtolower($tableColumn['domain_type']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    356
                 | 
                                    
                             445                          | 
                
                 | 
                            $tableColumn['complete_type'] = $tableColumn['domain_complete_type'];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    357
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    358
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    359
                 | 
                                    
                             445                          | 
                
                 | 
                        $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'])  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    360
                 | 
                                    
                             445                          | 
                
                 | 
                            ?? $this->_platform->getDoctrineTypeMapping($dbType);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    361
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    362
                 | 
                                    
                                                     | 
                
                 | 
                        switch ($dbType) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    363
                 | 
                                    
                             406                          | 
                
                 | 
                            case 'smallint':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    364
                 | 
                                    
                             406                          | 
                
                 | 
                            case 'int2':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    365
                 | 
                                    
                                                     | 
                
                 | 
                                $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    366
                 | 
                                    
                                                     | 
                
                 | 
                                $length                 = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    367
                 | 
                                    
                             445                          | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    368
                 | 
                                    
                             445                          | 
                
                 | 
                            case 'int':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    369
                 | 
                                    
                                                     | 
                
                 | 
                            case 'int4':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    370
                 | 
                                    
                             445                          | 
                
                 | 
                            case 'integer':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    371
                 | 
                                    
                                                     | 
                
                 | 
                                $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    372
                 | 
                                    
                                                     | 
                
                 | 
                                $length                 = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    373
                 | 
                                    
                             317                          | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    374
                 | 
                                    
                             317                          | 
                
                 | 
                            case 'bigint':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    375
                 | 
                                    
                             317                          | 
                
                 | 
                            case 'int8':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    376
                 | 
                                    
                                                     | 
                
                 | 
                                $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    377
                 | 
                                    
                                                     | 
                
                 | 
                                $length                 = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    378
                 | 
                                    
                                                     | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    379
                 | 
                                    
                             445                          | 
                
                 | 
                            case 'bool':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    380
                 | 
                                    
                             445                          | 
                
                 | 
                            case 'boolean':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    381
                 | 
                                    
                             445                          | 
                
                 | 
                                if ($tableColumn['default'] === 'true') { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    382
                 | 
                                    
                                                     | 
                
                 | 
                                    $tableColumn['default'] = true;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    383
                 | 
                                    
                                                     | 
                
                 | 
                                }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    384
                 | 
                                    
                             317                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    385
                 | 
                                    
                             317                          | 
                
                 | 
                                if ($tableColumn['default'] === 'false') { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    386
                 | 
                                    
                             317                          | 
                
                 | 
                                    $tableColumn['default'] = false;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    387
                 | 
                                    
                                                     | 
                
                 | 
                                }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    388
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    389
                 | 
                                    
                             439                          | 
                
                 | 
                                $length = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    390
                 | 
                                    
                                                     | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    391
                 | 
                                    
                                                     | 
                
                 | 
                            case 'text':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    392
                 | 
                                    
                                                     | 
                
                 | 
                            case '_varchar':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    393
                 | 
                                    
                             439                          | 
                
                 | 
                            case 'varchar':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    394
                 | 
                                    
                             439                          | 
                
                 | 
                                $tableColumn['default'] = $this->parseDefaultExpression($tableColumn['default']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    395
                 | 
                                    
                                                     | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    396
                 | 
                                    
                                                     | 
                
                 | 
                            case 'char':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    397
                 | 
                                    
                             439                          | 
                
                 | 
                            case 'bpchar':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    398
                 | 
                                    
                             439                          | 
                
                 | 
                                $fixed = true;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    399
                 | 
                                    
                                                     | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    400
                 | 
                                    
                                                     | 
                
                 | 
                            case 'float':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    401
                 | 
                                    
                                                     | 
                
                 | 
                            case 'float4':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    402
                 | 
                                    
                             433                          | 
                
                 | 
                            case 'float8':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    403
                 | 
                                    
                             433                          | 
                
                 | 
                            case 'double':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    404
                 | 
                                    
                                                     | 
                
                 | 
                            case 'double precision':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    405
                 | 
                                    
                                                     | 
                
                 | 
                            case 'real':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    406
                 | 
                                    
                             334                          | 
                
                 | 
                            case 'decimal':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    407
                 | 
                                    
                             334                          | 
                
                 | 
                            case 'money':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    408
                 | 
                                    
                                                     | 
                
                 | 
                            case 'numeric':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    409
                 | 
                                    
                                                     | 
                
                 | 
                                $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    410
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    411
                 | 
                                    
                                                     | 
                
                 | 
                                if (preg_match('([A-Za-z]+\(([0-9]+)\,([0-9]+)\))', $tableColumn['complete_type'], $match)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    412
                 | 
                                    
                                                     | 
                
                 | 
                                    $precision = (int) $match[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    413
                 | 
                                    
                                                     | 
                
                 | 
                                    $scale     = (int) $match[2];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    414
                 | 
                                    
                                                     | 
                
                 | 
                                    $length    = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    415
                 | 
                                    
                                                     | 
                
                 | 
                                }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    416
                 | 
                                    
                                                     | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    417
                 | 
                                    
                             406                          | 
                
                 | 
                            case 'year':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    418
                 | 
                                    
                                                     | 
                
                 | 
                                $length = null;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    419
                 | 
                                    
                             406                          | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    420
                 | 
                                    
                             406                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    421
                 | 
                                    
                             406                          | 
                
                 | 
                            // PostgreSQL 9.4+ only  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    422
                 | 
                                    
                             406                          | 
                
                 | 
                            case 'jsonb':  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    423
                 | 
                                    
                                                     | 
                
                 | 
                                $jsonb = true;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    424
                 | 
                                    
                             406                          | 
                
                 | 
                                break;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    425
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    426
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    427
                 | 
                                    
                                                     | 
                
                 | 
                        if ($tableColumn['default'] && preg_match("('([^']+)'::)", $tableColumn['default'], $match)) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    428
                 | 
                                    
                                                     | 
                
                 | 
                            $tableColumn['default'] = $match[1];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    429
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    430
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    431
                 | 
                                    
                             268                          | 
                
                 | 
                        $options = [  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    432
                 | 
                                    
                             268                          | 
                
                 | 
                            'length'        => $length,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    433
                 | 
                                    
                                                     | 
                
                 | 
                            'notnull'       => (bool) $tableColumn['isnotnull'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    434
                 | 
                                    
                                                     | 
                
                 | 
                            'default'       => $tableColumn['default'],  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    435
                 | 
                                    
                             445                          | 
                
                 | 
                            'precision'     => $precision,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    436
                 | 
                                    
                             433                          | 
                
                 | 
                            'scale'         => $scale,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    437
                 | 
                                    
                                                     | 
                
                 | 
                            'fixed'         => $fixed,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    438
                 | 
                                    
                                                     | 
                
                 | 
                            'unsigned'      => false,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    439
                 | 
                                    
                                                     | 
                
                 | 
                            'autoincrement' => $autoincrement,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    440
                 | 
                                    
                             445                          | 
                
                 | 
                            'comment'       => isset($tableColumn['comment']) && $tableColumn['comment'] !== ''  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    441
                 | 
                                    
                             445                          | 
                
                 | 
                                ? $tableColumn['comment']  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    442
                 | 
                                    
                             445                          | 
                
                 | 
                                : null,  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    443
                 | 
                                    
                             445                          | 
                
                 | 
                        ];  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    444
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    445
                 | 
                                    
                             445                          | 
                
                 | 
                        $column = new Column($tableColumn['field'], Type::getType($type), $options);  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    446
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    447
                 | 
                                    
                             445                          | 
                
                 | 
                        if (isset($tableColumn['collation']) && ! empty($tableColumn['collation'])) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    448
                 | 
                                    
                             445                          | 
                
                 | 
                            $column->setPlatformOption('collation', $tableColumn['collation']); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    449
                 | 
                                    
                             143                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    450
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    451
                 | 
                                    
                                                     | 
                
                 | 
                        if ($column->getType()->getName() === Types::JSON) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    452
                 | 
                                    
                                                     | 
                
                 | 
                            $column->setPlatformOption('jsonb', $jsonb); | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    453
                 | 
                                    
                             445                          | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    454
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    455
                 | 
                                    
                             445                          | 
                
                 | 
                        return $column;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    456
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    457
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    458
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    459
                 | 
                                    
                             445                          | 
                
                 | 
                     * PostgreSQL 9.4 puts parentheses around negative numeric default values that need to be stripped eventually.  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    460
                 | 
                                    
                             274                          | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    461
                 | 
                                    
                                                     | 
                
                 | 
                     * @param mixed $defaultValue  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    462
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    463
                 | 
                                    
                             445                          | 
                
                 | 
                     * @return mixed  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    464
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    465
                 | 
                                    
                                                     | 
                
                 | 
                    private function fixVersion94NegativeNumericDefaultValue($defaultValue)  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    466
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    467
                 | 
                                    
                                                     | 
                
                 | 
                        if ($defaultValue !== null && strpos($defaultValue, '(') === 0) { | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    468
                 | 
                                    
                                                     | 
                
                 | 
                            return trim($defaultValue, '()');  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    469
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    470
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    471
                 | 
                                    
                                                     | 
                
                 | 
                        return $defaultValue;  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    472
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    473
                 | 
                                    
                             445                          | 
                
                 | 
                 | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    474
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    475
                 | 
                                    
                             445                          | 
                
                 | 
                     * Parses a default value expression as given by PostgreSQL  | 
            
            
                                                                        
                            
            
                                    
            
            
                | 
                    476
                 | 
                                    
                             107                          | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    477
                 | 
                                    
                                                     | 
                
                 | 
                    private function parseDefaultExpression(?string $default) : ?string  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    478
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    479
                 | 
                                    
                             445                          | 
                
                 | 
                        if ($default === null) { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    480
                 | 
                                    
                                                     | 
                
                 | 
                            return $default;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    481
                 | 
                                    
                                                     | 
                
                 | 
                        }  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    482
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    483
                 | 
                                    
                                                     | 
                
                 | 
                        return str_replace("''", "'", $default); | 
            
            
                                                                        
                                                                
            
                                    
            
            
                | 
                    484
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                                        
                                                                
            
                                    
            
            
                | 
                    485
                 | 
                                    
                                                     | 
                
                 | 
                }  | 
            
            
                                                                        
                                                                
            
                                    
            
            
                | 
                    486
                 | 
                                    
                                                     | 
                
                 | 
                 |