migration-tools/0009-add-task_stream-table-in-database.patch

92 lines
2.9 KiB
Diff
Raw Normal View History

2024-11-04 11:18:09 +08:00
From 79ffefe397e47be74776b1761785f42049c67fae Mon Sep 17 00:00:00 2001
From: lixin <lixinb@uniontech.com>
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