浏览代码

脚本调整05.28.00

lijihong 6 年之前
父节点
当前提交
da44d24ab0
共有 2 个文件被更改,包括 55 次插入55 次删除
  1. 0 24
      TRS.WCM.Developer/贵州项目/0_update_data.sql
  2. 55 31
      TRS.WCM.Developer/贵州项目/readme.md

+ 0 - 24
TRS.WCM.Developer/贵州项目/0_update_data.sql

@@ -1,24 +0,0 @@
-# 预处理数据的SQL
-
-# 相关视频 FieldType 由 51 变为 20
-update XWCMDBFieldInfo set FieldType=20 where FieldType=51;
-update XWCMViewFieldInfo set FieldType=20 where FieldType=51;
-# 相关图片 FieldType 由 50 变为 32
-update XWCMDBFieldInfo set FieldType=32 where FieldType=50;
-update XWCMViewFieldInfo set FieldType=32 where FieldType=50;
-# 相关文档 FieldType 由 57 变为 31
-update XWCMDBFieldInfo set FieldType=31 where FieldType=57;
-update XWCMViewFieldInfo set FieldType=31 where FieldType=57;
-
-# mw_文本框 FieldType 由 53 变为 3
-update XWCMDBFieldInfo set FieldType=3 where FieldType in (53,65);
-update XWCMViewFieldInfo set FieldType=3 where FieldType in (53,65);
-# mw_是否按钮 FieldType 由 54 变为 5
-update XWCMDBFieldInfo set FieldType=5 where FieldType=54;
-update XWCMViewFieldInfo set FieldType=5 where FieldType=54;
-# mw_时间按钮FieldType 由 55 变为 11
-update XWCMDBFieldInfo set FieldType=11 where FieldType=55;
-update XWCMViewFieldInfo set FieldType=11 where FieldType=55;
-# mw_复杂编辑器 FieldType 由 63 变为 12
-update XWCMDBFieldInfo set FieldType=12 where FieldType=63;
-update XWCMViewFieldInfo set FieldType=12 where FieldType=63;

+ 55 - 31
TRS.WCM.Developer/贵州项目/readme.md

@@ -6,21 +6,45 @@
 1. 数据准备与wiki中相同。中间库可以根据节点自己区分。
    * 将wiki中记录的表,元数据表以及mas表迁移到对应的中间库中。
    * 在Navicat中,运行1-3的所有存储过程。
-```sql
-#删除有问题的素材库数据
-DELETE FROM xwcmmaterial WHERE MATERIALTYPE = 1 and FILENAME is NULL;
-DELETE FROM xwcmmaterial WHERE MATERIALTYPE = 2 and MASID is NULL;
-#查询表中是否存在唯一建重复
-SELECT DOCID,CHNLID FROM wcmchnldoc GROUP BY DOCID,CHNLID HAVING COUNT(1) > 1;
-```
+     ```sql
+        #删除有问题的素材库数据
+        DELETE FROM xwcmmaterial WHERE MATERIALTYPE = 1 and FILENAME is NULL;
+        DELETE FROM xwcmmaterial WHERE MATERIALTYPE = 2 and MASID is NULL;
+        #查询表中是否存在唯一建重复
+        SELECT DOCID,CHNLID FROM wcmchnldoc GROUP BY DOCID,CHNLID HAVING COUNT(1) > 1;
+     ```
    
 2. 迁移站点,栏目,视图,模板等基本数据。(用户可以在新系统中增加角色,调整视图和模板)
-  ```sql
-  call sp_city_base(节点ID);
-  ```
-   * 处理元数据字段对应(见:0_update_data.sql).
-   * 处理元数据表信息;需要先对迁移元数据表进行整理,将需要迁移的元数据表拷贝到中间库。
-    * 中间库,删除多余字段元数据,添加默认的元数据字段
+    * 处理数据中视图字段,使字段字段对应;
+      ```sql
+        # 相关视频 FieldType 由 51 变为 20
+        update XWCMDBFieldInfo set FieldType=20 where FieldType=51;
+        update XWCMViewFieldInfo set FieldType=20 where FieldType=51;
+        # 相关图片 FieldType 由 50 变为 32
+        update XWCMDBFieldInfo set FieldType=32 where FieldType=50;
+        update XWCMViewFieldInfo set FieldType=32 where FieldType=50;
+        # 相关文档 FieldType 由 57 变为 31
+        update XWCMDBFieldInfo set FieldType=31 where FieldType=57;
+        update XWCMViewFieldInfo set FieldType=31 where FieldType=57;
+        # mw_文本框 FieldType 由 53 变为 3
+        update XWCMDBFieldInfo set FieldType=3 where FieldType in (53,65);
+        update XWCMViewFieldInfo set FieldType=3 where FieldType in (53,65);
+        # mw_是否按钮 FieldType 由 54 变为 5
+        update XWCMDBFieldInfo set FieldType=5 where FieldType=54;
+        update XWCMViewFieldInfo set FieldType=5 where FieldType=54;
+        # mw_时间按钮FieldType 由 55 变为 11
+        update XWCMDBFieldInfo set FieldType=11 where FieldType=55;
+        update XWCMViewFieldInfo set FieldType=11 where FieldType=55;
+        # mw_复杂编辑器 FieldType 由 63 变为 12
+        update XWCMDBFieldInfo set FieldType=12 where FieldType=63;
+        update XWCMViewFieldInfo set FieldType=12 where FieldType=63;
+      ```
+    * 迁移站点,栏目,视图到trs_hycloud_iip;
+      ```sql
+        call sp_city_base(节点ID);
+      ```
+    * 处理元数据表信息;需要先对迁移元数据表进行整理,将需要迁移的元数据表拷贝到中间库;
+      * 中间库,删除多余字段元数据,添加默认的元数据字段
        ```sql
          SELECT prev_id from data_migration_log where table_name = 'xwcmtableinfo';
          # 注意该脚本结果为sql 脚本。需要复制脚本再执行一遍。
@@ -28,7 +52,7 @@ SELECT DOCID,CHNLID FROM wcmchnldoc GROUP BY DOCID,CHNLID HAVING COUNT(1) > 1;
        ```
       * 中间库修改元数据表名;
       ```sql
-      #获取修改元数据的表名的SQL
+       #获取修改元数据的表名的SQL
        SELECT
        	CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO ', table_name, '_city4', ';' ) sqls 
        FROM
@@ -39,29 +63,29 @@ SELECT DOCID,CHNLID FROM wcmchnldoc GROUP BY DOCID,CHNLID HAVING COUNT(1) > 1;
       ```
       * 生成创建表sql以保存元数据表索引
       ```sql
-      SELECT concat('create table trs_hycloud_iip.wcmmetatable',TABLENAME,'_city5 like ','wcmmetatable',TABLENAME,'_city5;') from xwcmtableinfo;
+        SELECT concat('create table trs_hycloud_iip.wcmmetatable',TABLENAME,'_city5 like ','wcmmetatable',TABLENAME,'_city5;') from xwcmtableinfo;
       ```
 3. 迁移数据 和 附件。
 
    * 将wcmdocuemnt,wcmchnldoc 元数据表中的数据拷贝到trs_hycloud_iip
-   ```sql
-   #生成插入数据sql
-   SELECT concat('INSERT INTO trs_hycloud_iip.wcmmetatable',TABLENAME,'_city5 SELECT * from ','wcmmetatable',TABLENAME,'_city5;') from xwcmtableinfo;
-   ```
+     ```sql
+       #生成插入数据sql
+       SELECT concat('INSERT INTO trs_hycloud_iip.wcmmetatable',TABLENAME,'_city5 SELECT * from ','wcmmetatable',TABLENAME,'_city5;') from xwcmtableinfo;
+     ```
    * 执行迁移脚本
-   ```sql 
-   call sp_city_data(节点ID)
-   ```
+     ```sql 
+      call sp_city_data(节点ID)
+     ```
    * 迁移附件  **注意必须要对迁移数据表建主键索引**
-   ``` 
-   #迁移附件
-   call sp_city_appendix(节点ID);
-   #mas数据迁移
-   call sp_city_mas();
-   ```
+     ``` 
+      #迁移附件
+      call sp_city_appendix(节点ID);
+      #mas数据迁移
+      call sp_city_mas();
+     ```
    * 修改元数据中相关图片,相关视频字段不对
-   ```sql
-   call update_data_relation_appendix(节点ID, masurl前缀, 起始tabelID,起始docId);
-   ```
+     ```sql
+       call update_data_relation_appendix(节点ID, masurl前缀, 起始tabelID,起始docId);
+     ```