🎉 First commit !!!
This commit is contained in:
25
backend/idfm_matrix_backend/models/user.py
Normal file
25
backend/idfm_matrix_backend/models/user.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from sqlalchemy import Column, ForeignKey, String, Table
|
||||
from sqlalchemy.orm import Mapped, relationship
|
||||
|
||||
from ..db import Base, db
|
||||
from .stop import _Stop
|
||||
|
||||
user_last_stop_search_stops_associations_table = Table(
|
||||
"user_last_stop_search_stops_associations_table",
|
||||
Base.metadata,
|
||||
Column("user_mxid", ForeignKey("user_last_stop_search_results.user_mxid")),
|
||||
Column("stop_id", ForeignKey("_stops.id")),
|
||||
)
|
||||
|
||||
|
||||
class UserLastStopSearchResults(Base):
|
||||
|
||||
db = db
|
||||
|
||||
__tablename__ = "user_last_stop_search_results"
|
||||
|
||||
user_mxid = Column(String, primary_key=True)
|
||||
request_content = Column(String, nullable=False)
|
||||
stops: Mapped[list[_Stop]] = relationship(
|
||||
_Stop, secondary=user_last_stop_search_stops_associations_table
|
||||
)
|
Reference in New Issue
Block a user