🐛 修复后端回收站部署内容

This commit is contained in:
orion committed 2026-09-11 16:59:07 +08:00
1 parent 8badb80600
commit dddca40df8
22 files changed
+986 -124

No files matched your search

@@ -0,0 +1,31 @@
from tortoise import connections
async def migrate():
conn = connections.get("default")
await conn.execute_script(
"""
CREATE TABLE IF NOT EXISTS transfer_stats (
id INTEGER PRIMARY KEY AUTOINCREMENT,
action VARCHAR(16) NOT NULL,
file_code_id INT NULL,
code VARCHAR(255) NULL,
name VARCHAR(512) NOT NULL DEFAULT '',
size BIGINT NOT NULL DEFAULT 0,
ip VARCHAR(64) NOT NULL DEFAULT '',
file_path VARCHAR(1024) NOT NULL DEFAULT '',
expired_at TIMESTAMP NULL,
deleted_at TIMESTAMP NULL,
meta TEXT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_transfer_stats_action_created
ON transfer_stats(action, created_at);
CREATE INDEX IF NOT EXISTS idx_transfer_stats_file_code_id
ON transfer_stats(file_code_id);
CREATE INDEX IF NOT EXISTS idx_transfer_stats_code
ON transfer_stats(code);
CREATE INDEX IF NOT EXISTS idx_transfer_stats_deleted_at
ON transfer_stats(deleted_at);
"""
)