mirror of
https://github.com/maubot/maubot
synced 2025-08-29 15:40:37 +00:00
More changes
This commit is contained in:
parent
0b246e44a8
commit
eef052b1e9
9 changed files with 195 additions and 61 deletions
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
from typing import Type
|
||||
from sqlalchemy import (Column, String, Boolean, ForeignKey, Text, TypeDecorator)
|
||||
from sqlalchemy.orm import Query
|
||||
from sqlalchemy.orm import Query, scoped_session
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
import json
|
||||
|
||||
|
@ -89,3 +89,9 @@ class DBCommandSpec(Base):
|
|||
ForeignKey("client.id", onupdate="CASCADE", ondelete="CASCADE"),
|
||||
primary_key=True)
|
||||
spec: CommandSpec = Column(make_serializable_alchemy(CommandSpec), nullable=False)
|
||||
|
||||
|
||||
def init(session: scoped_session) -> None:
|
||||
DBPlugin.query = session.query_property()
|
||||
DBClient.query = session.query_property()
|
||||
DBCommandSpec.query = session.query_property()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue