mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: 迁移脚本创建 video endpoint 时补充 created_at/updated_at 字段
修复 create_video_endpoints() 函数 INSERT 语句缺少时间戳字段导致的 NOT NULL 约束错误。
This commit is contained in:
@@ -9,6 +9,7 @@ Create Date: 2026-01-31 15:30:00.000000
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from typing import Sequence, Union
|
||||
from uuid import uuid4
|
||||
|
||||
@@ -261,6 +262,7 @@ def create_video_endpoints(connection) -> None:
|
||||
else:
|
||||
continue
|
||||
|
||||
now = datetime.now(timezone.utc)
|
||||
connection.execute(
|
||||
text("""
|
||||
INSERT INTO provider_endpoints
|
||||
@@ -277,7 +279,9 @@ def create_video_endpoints(connection) -> None:
|
||||
custom_path,
|
||||
config,
|
||||
format_acceptance_config,
|
||||
proxy
|
||||
proxy,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@@ -293,7 +297,9 @@ def create_video_endpoints(connection) -> None:
|
||||
NULL,
|
||||
:config,
|
||||
:format_acceptance_config,
|
||||
:proxy
|
||||
:proxy,
|
||||
:created_at,
|
||||
:updated_at
|
||||
)
|
||||
"""),
|
||||
{
|
||||
@@ -308,6 +314,8 @@ def create_video_endpoints(connection) -> None:
|
||||
"config": _json_dumps(_json_loads(row.config)),
|
||||
"format_acceptance_config": _json_dumps(_json_loads(row.format_acceptance_config)),
|
||||
"proxy": _json_dumps(_json_loads(row.proxy)),
|
||||
"created_at": now,
|
||||
"updated_at": now,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user