feat: sqlalchemy defined orgusers relationship

This commit is contained in:
Chris Milne 2026-05-25 10:21:15 +01:00
parent d51adb4e55
commit 4ff184fe86
2 changed files with 14 additions and 0 deletions

View file

@ -5,6 +5,7 @@ Models:
- User - id[pk], email, first_name, last_name, oidc_id
"""
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship
from src.database import Base
@ -17,3 +18,9 @@ class User(Base):
first_name = Column(String)
last_name = Column(String)
oidc_id = Column(String, index=True, unique=True)
organisations = relationship(
"Organisation",
secondary="orgusers",
back_populates="users"
)