mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
API CHANGE: postgres boolean type changed to smallint
This commit is contained in:
parent
e1add0138e
commit
dfb831cd38
@ -109,6 +109,7 @@ class PostgreSQLDatabase extends Database {
|
|||||||
$starttime = microtime(true);
|
$starttime = microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//echo $sql . '<hr>';
|
||||||
$handle = pg_query($this->dbConn, $sql);
|
$handle = pg_query($this->dbConn, $sql);
|
||||||
|
|
||||||
if(isset($_REQUEST['showqueries'])) {
|
if(isset($_REQUEST['showqueries'])) {
|
||||||
@ -624,12 +625,12 @@ class PostgreSQLDatabase extends Database {
|
|||||||
*/
|
*/
|
||||||
public function boolean($values, $asDbValue=false){
|
public function boolean($values, $asDbValue=false){
|
||||||
//Annoyingly, we need to do a good ol' fashioned switch here:
|
//Annoyingly, we need to do a good ol' fashioned switch here:
|
||||||
($values['default']) ? $default='true' : $default='false';
|
($values['default']) ? $default='1' : $default='0';
|
||||||
|
|
||||||
if($asDbValue)
|
if($asDbValue)
|
||||||
return Array('data_type'=>'boolean');
|
return Array('data_type'=>'smallint');
|
||||||
else
|
else
|
||||||
return 'boolean not null default ' . $default;
|
return 'smallint not null default ' . $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user