mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 15:05:45 +00:00
MINOR: time and float data types now supported. Index information now returned correctly and won't trigger index rebuilds
This commit is contained in:
parent
f3e29be23c
commit
07e7579f4f
@ -591,7 +591,6 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
$output = array();
|
$output = array();
|
||||||
if($fields) foreach($fields as $field) {
|
if($fields) foreach($fields as $field) {
|
||||||
|
|
||||||
|
|
||||||
switch($field['data_type']){
|
switch($field['data_type']){
|
||||||
case 'character varying':
|
case 'character varying':
|
||||||
//Check to see if there's a constraint attached to this column:
|
//Check to see if there's a constraint attached to this column:
|
||||||
@ -654,6 +653,14 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
$output[$field['column_name']]='smallint default ' . $field['column_default'];
|
$output[$field['column_name']]='smallint default ' . $field['column_default'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'time without time zone':
|
||||||
|
$output[$field['column_name']]='time';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'double precision':
|
||||||
|
$output[$field['column_name']]='float';
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$output[$field['column_name']] = $field;
|
$output[$field['column_name']] = $field;
|
||||||
}
|
}
|
||||||
@ -694,12 +701,12 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
$indexSpec='unique (' . $indexSpec['value'] . ')';
|
$indexSpec='unique (' . $indexSpec['value'] . ')';
|
||||||
break;
|
break;
|
||||||
case 'hash':
|
case 'hash':
|
||||||
$indexSpec='using hash (' . $indexSpec['value'] . ')';
|
$indexSpec='(' . $indexSpec['value'] . ')';
|
||||||
break;
|
break;
|
||||||
case 'index':
|
case 'index':
|
||||||
//The default index is 'btree', which we'll use by default (below):
|
//The default index is 'btree', which we'll use by default (below):
|
||||||
default:
|
default:
|
||||||
$indexSpec='using btree (' . $indexSpec['value'] . ')';
|
$indexSpec='(' . $indexSpec['value'] . ')';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user