web sttarting

This commit is contained in:
2026-03-31 13:25:14 +05:00
parent 9cd6d83428
commit 59b3bcd0f4
30 changed files with 720 additions and 242 deletions

View File

@@ -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"]