web sttarting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from sqlalchemy import Column, String
|
||||
from sqlalchemy import Column, String, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.orm import relationship
|
||||
from .simple_base import Base
|
||||
import uuid
|
||||
|
||||
@@ -12,5 +13,11 @@ class User(Base):
|
||||
username = Column(String(150), nullable=False, unique=True)
|
||||
hashed_password = Column(String(256), nullable=False)
|
||||
|
||||
group_id = Column(UUID(as_uuid=True), ForeignKey("group.id", ondelete="SET NULL"), nullable=True)
|
||||
organization_id = Column(UUID(as_uuid=True), ForeignKey("organization.id", ondelete="SET NULL"), nullable=True)
|
||||
|
||||
group = relationship("Group", foreign_keys=[group_id])
|
||||
organization = relationship("Organization", foreign_keys=[organization_id])
|
||||
|
||||
__all__ = ["Base", "User"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user