Files
Canto/canto-backend/db/migrate_add_local_permission.py
bdim404 2fa9c1fcb6 refactor: rename backend/frontend dirs and remove NovelWriter submodule
- Rename qwen3-tts-backend → canto-backend
- Rename qwen3-tts-frontend → canto-frontend
- Remove NovelWriter embedded repo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 18:03:29 +08:00

18 lines
552 B
Python

from sqlalchemy import create_engine, text
from core.config import settings
def migrate():
engine = create_engine(settings.DATABASE_URL)
with engine.connect() as conn:
conn.execute(text(
"ALTER TABLE users ADD COLUMN can_use_local_model BOOLEAN DEFAULT 0 NOT NULL"
))
conn.execute(text(
"UPDATE users SET can_use_local_model = 1 WHERE is_superuser = 1"
))
conn.commit()
print("Migration completed: Added can_use_local_model column")
if __name__ == "__main__":
migrate()