Files
OpenHands/enterprise/storage/slack_user.py
chuckbutkus d5e66b4f3a SAAS: Introducing orgs (phase 1) (#11265)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: rohitvinodmalhotra@gmail.com <rohitvinodmalhotra@gmail.com>
Co-authored-by: Hiep Le <69354317+hieptl@users.noreply.github.com>
Co-authored-by: Tim O'Farrell <tofarr@gmail.com>
2026-01-15 22:03:31 -05:00

22 lines
799 B
Python

from sqlalchemy import Column, DateTime, ForeignKey, Identity, Integer, String, text
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from storage.base import Base
class SlackUser(Base): # type: ignore
__tablename__ = 'slack_users'
id = Column(Integer, Identity(), primary_key=True)
keycloak_user_id = Column(String, nullable=False, index=True)
org_id = Column(UUID(as_uuid=True), ForeignKey('org.id'), nullable=True)
slack_user_id = Column(String, nullable=False, index=True)
slack_display_name = Column(String, nullable=False)
created_at = Column(
DateTime,
server_default=text('CURRENT_TIMESTAMP'),
nullable=False,
)
# Relationships
org = relationship('Org', back_populates='slack_users')