模板在线编辑与导出链路重构
This commit is contained in:
@@ -22,6 +22,7 @@ async def get_db():
|
||||
async def init_db():
|
||||
from models.template import Template
|
||||
from models.paragraph import Paragraph
|
||||
from models.template_block import TemplateBlock
|
||||
from models.ai_model import AiModel
|
||||
from models.document import Document
|
||||
from models.generation_log import GenerationLog
|
||||
@@ -53,3 +54,6 @@ async def init_db():
|
||||
await conn.execute(text("UPDATE paragraphs SET anchor_title = title WHERE anchor_title = '' OR anchor_title IS NULL"))
|
||||
if "write_mode" not in paragraph_columns:
|
||||
await conn.execute(text("ALTER TABLE paragraphs ADD COLUMN write_mode VARCHAR(30) DEFAULT 'replace_section'"))
|
||||
block_tables = await conn.run_sync(lambda sync_conn: inspect(sync_conn).get_table_names())
|
||||
if "template_blocks" not in block_tables:
|
||||
await conn.run_sync(lambda sync_conn: TemplateBlock.__table__.create(sync_conn))
|
||||
|
||||
Reference in New Issue
Block a user