فهرست منبع

Upgrade script from 15.0.0-RC1 to 15.0.0-RC2

Aleksandr Trofimov 1 ماه پیش
والد
کامیت
71322ff9eb
2فایلهای تغییر یافته به همراه15 افزوده شده و 3 حذف شده
  1. 11 0
      upgrade/files/15.0.0.RC1-15.0.0.RC2/script.php
  2. 4 3
      upgrade/files/15.0.0.RC1-15.0.0.RC2/sql.sql

+ 11 - 0
upgrade/files/15.0.0.RC1-15.0.0.RC2/script.php

@@ -43,4 +43,15 @@
     $aPathInfo = pathinfo(__FILE__);
     $this->oDb->executeSQL($aPathInfo['dirname'] . '/sys-alerts-desc.sql');
 
+    if (($oStorage = BxDolStorage::getObjectInstance('sys_agents_assistants_chats_files')) !== false) {
+        $aFiles = $oStorage->getFiles(false);
+        if (is_array($aFiles)) {
+            foreach ($aFiles as $aFile)
+                $oStorage->deleteFile($aFile['id']);
+        }
+
+        $this->oDb->query("DELETE FROM `sys_objects_storage` WHERE `object` = 'sys_agents_assistants_chats_files'");
+        $this->oDb->query("DROP TABLE IF EXISTS `sys_agents_assistants_chats_files`");
+    }
+
     return true;

+ 4 - 3
upgrade/files/15.0.0.RC1-15.0.0.RC2/sql.sql

@@ -54,7 +54,7 @@ UPDATE `sys_modules` SET `vendor` = 'UNA INC', `version` = '', `path` = 'system/
 UPDATE `sys_alerts_handlers` SET `class` = 'BxDolAiTriggerMessage', `file` = 'inc/classes/BxDolAiTriggerMessage.php' WHERE `name` = 'sys_agents';
 
 -- sys_objects_storage
--- TODO: delete actual files from the storage engine, then later delete storage
+-- Files and the storage object are removed in script.php after SQL, so the files table must still exist here.
 -- DELETE FROM `sys_objects_storage` WHERE `object` = 'sys_agents_assistants_chats_files';
 
 /* Removed sys_agents_comment form inputs */
@@ -211,7 +211,8 @@ INSERT INTO `sys_preloader` (`module`, `type`, `content`, `active`, `ORDER`) VAL
 -- Data: sys_std_pages
 UPDATE `sys_std_pages` SET `icon` = 'tmi-launcher.svg' WHERE `name` = 'home' AND `icon` = 'bc-home.svg';
 
-DROP TABLE IF EXISTS `sys_agents_automators`;
+-- DROP TABLE IF EXISTS `sys_agents_automators`;
+
 DROP TABLE IF EXISTS `sys_agents_automators_providers`;
 DROP TABLE IF EXISTS `sys_agents_automators_helpers`;
 DROP TABLE IF EXISTS `sys_agents_automators_assistants`;
@@ -225,7 +226,7 @@ DROP TABLE IF EXISTS `sys_agents_assistants`;
 DROP TABLE IF EXISTS `sys_agents_assistants_files`;
 DROP TABLE IF EXISTS `sys_agents_assistants_chats`;
 DROP TABLE IF EXISTS `sys_agents_assistants_chats_messages`;
-DROP TABLE IF EXISTS `sys_agents_assistants_chats_files`;
+-- DROP TABLE IF EXISTS `sys_agents_assistants_chats_files`;
 
 -- APP: pages