|
@@ -102,11 +102,17 @@ class Schema_SystemObjectStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
`isStructInstalled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'has installed structure',
|
|
`isStructInstalled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'has installed structure',
|
|
|
`isObjectActive` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'object is active',
|
|
`isObjectActive` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'object is active',
|
|
|
`description` varchar(255) DEFAULT '',
|
|
`description` varchar(255) DEFAULT '',
|
|
|
|
|
+ `primaryKey` varchar(255) DEFAULT '',
|
|
|
UNIQUE KEY `idZasob` (idZasob),
|
|
UNIQUE KEY `idZasob` (idZasob),
|
|
|
UNIQUE KEY `namespace` (namespace),
|
|
UNIQUE KEY `namespace` (namespace),
|
|
|
KEY `isObjectActive` (isObjectActive)
|
|
KEY `isObjectActive` (isObjectActive)
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
|
|
");
|
|
");
|
|
|
|
|
+ try {
|
|
|
|
|
+ DB::getPDO()->execSql(" ALTER TABLE `{$this->_rootTableName}` ADD `primaryKey` VARCHAR(255) NOT NULL DEFAULT '' AFTER `description` ");
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ DBG::log($e);
|
|
|
|
|
+ }
|
|
|
DB::getPDO()->execSql(" update `{$this->_rootTableName}` set hasStruct = 0 ");
|
|
DB::getPDO()->execSql(" update `{$this->_rootTableName}` set hasStruct = 0 ");
|
|
|
$idDefDB = DB::getPDO()->getZasobId();
|
|
$idDefDB = DB::getPDO()->getZasobId();
|
|
|
|
|
|
|
@@ -507,6 +513,7 @@ class Schema_SystemObjectStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
foreach ($itemPatch as $fieldName => $value) {
|
|
foreach ($itemPatch as $fieldName => $value) {
|
|
|
if ('isStructInstalled' == $fieldName) continue;
|
|
if ('isStructInstalled' == $fieldName) continue;
|
|
|
if ('isObjectActive' == $fieldName) continue;
|
|
if ('isObjectActive' == $fieldName) continue;
|
|
|
|
|
+ if ('primaryKey' == $fieldName) continue;
|
|
|
throw new Exception("Update field '{$fieldName}' not allowed for '{$this->_namespace}'");
|
|
throw new Exception("Update field '{$fieldName}' not allowed for '{$this->_namespace}'");
|
|
|
}
|
|
}
|
|
|
return DB::getPDO()->update($this->_rootTableName, $pkField, $pk, $itemPatch);
|
|
return DB::getPDO()->update($this->_rootTableName, $pkField, $pk, $itemPatch);
|