feat(audiobook): add gender field to audiobook character model and update related functionality

This commit is contained in:
2026-03-10 20:23:03 +08:00
parent addb152ce1
commit 2e005b0084
9 changed files with 50 additions and 8 deletions

View File

@@ -27,3 +27,12 @@ def get_db():
def init_db():
Base.metadata.create_all(bind=engine)
if "sqlite" in str(engine.url):
with engine.connect() as conn:
try:
conn.execute(__import__("sqlalchemy").text(
"ALTER TABLE audiobook_characters ADD COLUMN gender VARCHAR(20)"
))
conn.commit()
except Exception:
pass