🔧 chore: 同步完整后端运行模块
This commit is contained in:
1 parent
d104b9fc8b
commit
2d44699eec
20 files changed
+1465
-235
No files matched your search
@@ -0,0 +1,20 @@
|
||||
from tortoise import connections
|
||||
|
||||
|
||||
async def migrate():
|
||||
conn = connections.get("default")
|
||||
await conn.execute_script(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS share_code_reservations (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
code VARCHAR(255) NOT NULL UNIQUE,
|
||||
file_code_id INT NULL,
|
||||
reason VARCHAR(32) NOT NULL DEFAULT 'retired',
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_share_code_reservations_code
|
||||
ON share_code_reservations(code);
|
||||
CREATE INDEX IF NOT EXISTS idx_share_code_reservations_file_code_id
|
||||
ON share_code_reservations(file_code_id);
|
||||
"""
|
||||
)
|
||||
Reference in new issue
Block a user