Even more migrations to mautrix-python
This commit is contained in:
@@ -18,10 +18,8 @@ from .bot_chat import BotChat
|
||||
from .message import Message
|
||||
from .portal import Portal
|
||||
from .puppet import Puppet
|
||||
from .room_state import RoomState
|
||||
from .telegram_file import TelegramFile
|
||||
from .user import User, UserPortal, Contact
|
||||
from .user_profile import UserProfile
|
||||
|
||||
|
||||
def init(db_engine) -> None:
|
||||
|
||||
@@ -23,10 +23,10 @@ from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
|
||||
class BaseBase:
|
||||
db = None # type: Engine
|
||||
t = None # type: Table
|
||||
__table__ = None # type: Table
|
||||
c = None # type: ImmutableColumnCollection
|
||||
db: Engine = None
|
||||
t: Table = None
|
||||
__table__: Table = None
|
||||
c: ImmutableColumnCollection = None
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
@@ -54,4 +54,5 @@ class BaseBase:
|
||||
with self.db.begin() as conn:
|
||||
conn.execute(self.t.delete().where(self._edit_identity))
|
||||
|
||||
|
||||
Base = declarative_base(cls=BaseBase)
|
||||
|
||||
Reference in New Issue
Block a user