mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 13:48:37 +02:00
API CHANGE: Postgres support for T-search indexes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73249 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2a2e83f8e3
commit
e76d876b73
@ -714,11 +714,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
|
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
$defaults = Object::get_static($class, 'defaults');
|
$defaults = Object::get_static($class, 'defaults');
|
||||||
|
|
||||||
if($defaults) foreach($defaults as $fieldName => $fieldValue) {
|
if($defaults) foreach($defaults as $fieldName => $fieldValue) {
|
||||||
// SRM 2007-03-06: Stricter check
|
// SRM 2007-03-06: Stricter check
|
||||||
if(!isset($this->$fieldName) || $this->$fieldName === null) {
|
if(!isset($this->$fieldName) || $this->$fieldName === null) {
|
||||||
$this->$fieldName = $fieldValue;
|
$this->$fieldName = $fieldValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
// Set many-many defaults with an array of ids
|
// Set many-many defaults with an array of ids
|
||||||
if(is_array($fieldValue) && $this->many_many($fieldName)) {
|
if(is_array($fieldValue) && $this->many_many($fieldName)) {
|
||||||
@ -836,6 +836,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
if(isset($ancestry) && is_array($ancestry)) {
|
if(isset($ancestry) && is_array($ancestry)) {
|
||||||
foreach($ancestry as $idx => $class) {
|
foreach($ancestry as $idx => $class) {
|
||||||
$classSingleton = singleton($class);
|
$classSingleton = singleton($class);
|
||||||
|
|
||||||
foreach($this->record as $fieldName => $fieldValue) {
|
foreach($this->record as $fieldName => $fieldValue) {
|
||||||
if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) {
|
if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) {
|
||||||
$fieldObj = $this->dbObject($fieldName);
|
$fieldObj = $this->dbObject($fieldName);
|
||||||
|
@ -299,11 +299,12 @@ abstract class Database extends Object {
|
|||||||
$this->indexList[$table] = $this->indexList($table);
|
$this->indexList[$table] = $this->indexList($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
$index_alt=DB::getConn()->modifyIndex($index);
|
|
||||||
|
|
||||||
//Fix up the index for database purposes
|
//Fix up the index for database purposes
|
||||||
$index=DB::getConn()->getDbSqlDefinition($table, $index, null, true);
|
$index=DB::getConn()->getDbSqlDefinition($table, $index, null, true);
|
||||||
|
|
||||||
|
//Fix the key for database purposes
|
||||||
|
$index_alt=DB::getConn()->modifyIndex($index, $spec);
|
||||||
|
|
||||||
if(!$newTable) {
|
if(!$newTable) {
|
||||||
if(is_array($this->indexList[$table][$index_alt])) {
|
if(is_array($this->indexList[$table][$index_alt])) {
|
||||||
$array_spec = $this->indexList[$table][$index_alt]['spec'];
|
$array_spec = $this->indexList[$table][$index_alt]['spec'];
|
||||||
|
Loading…
Reference in New Issue
Block a user