public function createPrimaryKey(array $columnNames, $name = null)
    {
        if ($this->hasPrimaryKey()) {
            throw SchemaException::tablePrimaryKeyAlreadyExists($this->getName());
        }

        $primaryKey = new PrimaryKey($name, $columnNames);
        $this->setPrimaryKey($primaryKey);

        $this->createIndex($columnNames, true, $primaryKey->getName());

        return $primaryKey;
    }