From 5e8f00f053ae353ed92788460d0410721fbab082 Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Mon, 4 Nov 2024 11:18:09 +0800 Subject: [PATCH] add task_stream table in database --- 0009-add-task_stream-table-in-database.patch | 91 ++++++++++++++++++++ migration-tools.spec | 7 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 0009-add-task_stream-table-in-database.patch diff --git a/0009-add-task_stream-table-in-database.patch b/0009-add-task_stream-table-in-database.patch new file mode 100644 index 0000000..9eac0c9 --- /dev/null +++ b/0009-add-task_stream-table-in-database.patch @@ -0,0 +1,91 @@ +From 79ffefe397e47be74776b1761785f42049c67fae Mon Sep 17 00:00:00 2001 +From: lixin +Date: Thu, 9 Nov 2023 14:51:51 +0800 +Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=B7=BB=E5=8A=A0ta?= + =?UTF-8?q?sk=5Fstream=E8=A1=A8?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + uos-sysmig.sql | 46 +++++++++++++++++++++++++++++++++++++++++++++- + views/server.py | 4 +++- + 2 files changed, 48 insertions(+), 2 deletions(-) + +diff --git a/uos-sysmig.sql b/uos-sysmig.sql +index eaf8aed..d65006d 100644 +--- a/uos-sysmig.sql ++++ b/uos-sysmig.sql +@@ -49,4 +49,48 @@ CREATE TABLE `agent_info` ( + LOCK TABLES `agent_info` WRITE; + /*!40000 ALTER TABLE `agent_info` DISABLE KEYS */; + /*!40000 ALTER TABLE `agent_info` ENABLE KEYS */; +-UNLOCK TABLES; +\ No newline at end of file ++UNLOCK TABLES; ++ ++-- ++-- Table structure for table `task_stream` ++-- ++ ++DROP TABLE IF EXISTS `task_stream`; ++/*!40101 SET @saved_cs_client = @@character_set_client */; ++/*!50503 SET character_set_client = utf8 */; ++CREATE TABLE `task_stream` ( ++ `task_stream_id` int NOT NULL AUTO_INCREMENT, ++ `agent_ip` varchar(256) DEFAULT NULL, ++ `agent_id` int DEFAULT NULL, ++ `tasks` varchar(256) DEFAULT NULL, ++ `stream_status` varchar(256) DEFAULT NULL, ++ `stream_CreateTime` timestamp NULL DEFAULT NULL, ++ `stream_Updatetime` timestamp NULL DEFAULT NULL, ++ PRIMARY KEY (`task_stream_id`), ++ KEY `task_stream_id` (`task_stream_id`) ++) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; ++/*!40101 SET character_set_client = @saved_cs_client */; ++ ++-- ++-- Dumping data for table `task_stream` ++-- ++ ++LOCK TABLES `task_stream` WRITE; ++/*!40000 ALTER TABLE `task_stream` DISABLE KEYS */; ++/*!40000 ALTER TABLE `task_stream` ENABLE KEYS */; ++UNLOCK TABLES; ++ ++-- ++-- Dumping routines for database 'uossysmig' ++-- ++/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; ++ ++/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; ++/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; ++/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; ++/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; ++/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; ++/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; ++/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; ++ ++-- Dump completed on 2022-09-06 17:43:02 +diff --git a/views/server.py b/views/server.py +index 65ddba9..121993a 100644 +--- a/views/server.py ++++ b/views/server.py +@@ -1,4 +1,5 @@ + import json ++from connect_sql import DBHelper + + def import_host_info(data): + """ +@@ -18,4 +19,5 @@ def import_host_info(data): + agent_ip = i.get('agent_ip') + agent_username = i.get('agent_hostname') + agent_passwd = i.get('agent_password') +- val = ((agent_ip, agent_username, agent_passwd),) +\ No newline at end of file ++ val = ((agent_ip, agent_username, agent_passwd),) ++ DBHelper().insert(sql, val) +\ No newline at end of file +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index e339aee..69e891e 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 8 +Release: 9 License: MulanPSL-2.0 Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system Source0: %{name}-%{version}.tar.gz @@ -15,6 +15,8 @@ Patch4: 0005-execution-sql-function.patch Patch5: 0006-add-loger-interface-function.patch Patch6: 0007-add-function-to-import-machine.patch Patch7: 0008-add-agent_info-table-in-database.patch +Patch8: 0009-add-task_stream-table-in-database.patch + BuildArch: noarch BuildRequires: systemd @@ -113,6 +115,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Mon Nov 4 2024 xuezhixin - 1.0.2-9 +- 0009-add-task_stream-table-in-database.patch + * Mon Nov 4 2024 xuezhixin - 1.0.2-8 - 0008-add-agent_info-table-in-database.patch -- Gitee