mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
refactor: move entities
This commit is contained in:
@@ -7,7 +7,7 @@ import sqlalchemy.ext.asyncio as sqlalchemy_asyncio
|
||||
import sqlalchemy
|
||||
|
||||
from . import database
|
||||
from .entities import user, base
|
||||
from ..entity.persistence import user, model, base
|
||||
from ..core import app
|
||||
from .databases import sqlite
|
||||
|
||||
@@ -34,6 +34,11 @@ class PersistenceManager:
|
||||
|
||||
await self.create_tables()
|
||||
|
||||
# auto migrate
|
||||
async with self.get_db_engine().connect() as conn:
|
||||
await conn.run_sync(self.meta.drop_all)
|
||||
await conn.run_sync(self.meta.create_all)
|
||||
|
||||
async def create_tables(self):
|
||||
# TODO: 对扩展友好
|
||||
|
||||
|
||||
Reference in New Issue
Block a user