Cake\Database\Schema\PostgresSchema::addConstraintSql PHP Method

addConstraintSql() public method

{@inheritDoc}
public addConstraintSql ( Cake\Database\Schema\Table $table )
$table Cake\Database\Schema\Table
    public function addConstraintSql(Table $table)
    {
        $sqlPattern = 'ALTER TABLE %s ADD %s;';
        $sql = [];
        foreach ($table->constraints() as $name) {
            $constraint = $table->constraint($name);
            if ($constraint['type'] === Table::CONSTRAINT_FOREIGN) {
                $tableName = $this->_driver->quoteIdentifier($table->name());
                $sql[] = sprintf($sqlPattern, $tableName, $this->constraintSql($table, $name));
            }
        }
        return $sql;
    }