mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
Merge pull request #38 from RantyDave/master
Fixes "alter table" problem when installing.
This commit is contained in:
commit
6661b0e133
@ -177,16 +177,16 @@ class PostgreSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelp
|
||||
}
|
||||
|
||||
public function requireDatabaseAlterPermissions($databaseConfig) {
|
||||
$success = false;
|
||||
$conn = $this->createConnection($databaseConfig, $error);
|
||||
if($conn) {
|
||||
// Check if this user has create privileges on the default tablespace
|
||||
$sqlUsername = $this->quote($conn, $databaseConfig['username']);
|
||||
$permissions = $this->query($conn, "select * from has_tablespace_privilege($sqlUsername, 'pg_default', 'create')");
|
||||
$success = $permissions && (reset($permissions) == 't');
|
||||
// if the account can even log in, it can alter tables
|
||||
return array(
|
||||
'success' => true,
|
||||
'applies' => true
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'success' => $success,
|
||||
'success' => false,
|
||||
'applies' => true
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user