mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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) {
|
||||
$defaults = Object::get_static($class, 'defaults');
|
||||
|
||||
if($defaults) foreach($defaults as $fieldName => $fieldValue) {
|
||||
// SRM 2007-03-06: Stricter check
|
||||
if(!isset($this->$fieldName) || $this->$fieldName === null) {
|
||||
$this->$fieldName = $fieldValue;
|
||||
|
||||
}
|
||||
// Set many-many defaults with an array of ids
|
||||
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)) {
|
||||
foreach($ancestry as $idx => $class) {
|
||||
$classSingleton = singleton($class);
|
||||
|
||||
foreach($this->record as $fieldName => $fieldValue) {
|
||||
if(isset($this->changed[$fieldName]) && $this->changed[$fieldName] && $fieldType = $classSingleton->hasOwnTableDatabaseField($fieldName)) {
|
||||
$fieldObj = $this->dbObject($fieldName);
|
||||
@ -3147,4 +3148,4 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -298,12 +298,13 @@ abstract class Database extends Object {
|
||||
if(!$newTable && !isset($this->indexList[$table])) {
|
||||
$this->indexList[$table] = $this->indexList($table);
|
||||
}
|
||||
|
||||
$index_alt=DB::getConn()->modifyIndex($index);
|
||||
|
||||
|
||||
//Fix up the index for database purposes
|
||||
$index=DB::getConn()->getDbSqlDefinition($table, $index, null, true);
|
||||
|
||||
//Fix the key for database purposes
|
||||
$index_alt=DB::getConn()->modifyIndex($index, $spec);
|
||||
|
||||
if(!$newTable) {
|
||||
if(is_array($this->indexList[$table][$index_alt])) {
|
||||
$array_spec = $this->indexList[$table][$index_alt]['spec'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user