mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
ENHANCEMENT: implemented missing hasTable method that returns if a given table exists in the postgres database.
This commit is contained in:
parent
0d090e971f
commit
a536ee1821
@ -1180,10 +1180,11 @@ class PostgreSQLDatabase extends SS_Database {
|
||||
|
||||
/**
|
||||
* Returns true if this table exists
|
||||
* @todo Make a proper implementation
|
||||
*/
|
||||
function hasTable($tableName) {
|
||||
return true;
|
||||
$result = $this->query("SELECT tablename FROM pg_tables WHERE tablename = '$tableName'");
|
||||
if ($result->numRecords() > 0) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user