🐛 封存历史审计与手工改码取件码
This commit is contained in:
1 parent
d75044e884
commit
5db619a1e8
3 files changed
+27
No files matched your search
@@ -0,0 +1,14 @@
|
||||
from tortoise import connections
|
||||
|
||||
|
||||
async def migrate():
|
||||
"""把既有审计日志中的取件码也登记为永久占用。"""
|
||||
conn = connections.get("default")
|
||||
await conn.execute_query(
|
||||
"""
|
||||
INSERT OR IGNORE INTO share_code_reservations (code, file_code_id, reason)
|
||||
SELECT DISTINCT TRIM(code), file_code_id, 'historical_audit'
|
||||
FROM transfer_stats
|
||||
WHERE code IS NOT NULL AND TRIM(code) <> ''
|
||||
"""
|
||||
)
|
||||
Reference in new issue
Block a user