修改ci/cd
This commit is contained in:
@@ -231,16 +231,21 @@ class DatabaseVersionManager:
|
|||||||
try:
|
try:
|
||||||
# 时间处理:与后端保持一致
|
# 时间处理:与后端保持一致
|
||||||
from datetime import timezone as dt_timezone
|
from datetime import timezone as dt_timezone
|
||||||
|
import uuid
|
||||||
|
|
||||||
beijing_time_naive = datetime.now()
|
beijing_time_naive = datetime.now()
|
||||||
beijing_time_as_utc = beijing_time_naive.replace(tzinfo=dt_timezone.utc)
|
beijing_time_as_utc = beijing_time_naive.replace(tzinfo=dt_timezone.utc)
|
||||||
|
|
||||||
|
# 生成UUID
|
||||||
|
record_id = str(uuid.uuid4())
|
||||||
|
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor()
|
||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
INSERT INTO web_version_history
|
INSERT INTO web_version_history
|
||||||
(version, type, content, download_url, release_time, is_delete)
|
(id, version, type, content, download_url, release_time, is_delete)
|
||||||
VALUES (%s, %s, %s, %s, %s, %s)
|
VALUES (%s, %s, %s, %s, %s, %s, %s)
|
||||||
RETURNING id
|
|
||||||
""", (
|
""", (
|
||||||
|
record_id,
|
||||||
version_record['version'],
|
version_record['version'],
|
||||||
'水滴智能通讯插件',
|
'水滴智能通讯插件',
|
||||||
version_record['content'],
|
version_record['content'],
|
||||||
@@ -249,11 +254,10 @@ class DatabaseVersionManager:
|
|||||||
False
|
False
|
||||||
))
|
))
|
||||||
|
|
||||||
version_id = cursor.fetchone()[0]
|
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
logger.info(f"✅ 版本记录已保存到数据库 (ID: {version_id})")
|
logger.info(f"✅ 版本记录已保存到数据库 (ID: {record_id})")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user