9 lines
366 B
Python
9 lines
366 B
Python
from tortoise import connections
|
|
|
|
|
|
async def migrate():
|
|
conn = connections.get('default')
|
|
columns = await conn.execute_query_dict('PRAGMA table_info(uploadchunk)')
|
|
if not any(column['name']=='storage_mode' for column in columns):
|
|
await conn.execute_script("ALTER TABLE uploadchunk ADD COLUMN storage_mode VARCHAR(32) NOT NULL DEFAULT 'legacy';")
|