mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
27 lines
947 B
Python
27 lines
947 B
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, String, text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from storage.base import Base
|
|
|
|
|
|
class LinearUser(Base):
|
|
__tablename__ = 'linear_users'
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
|
keycloak_user_id: Mapped[str] = mapped_column(String, nullable=False, index=True)
|
|
linear_user_id: Mapped[str] = mapped_column(String, nullable=False, index=True)
|
|
linear_workspace_id: Mapped[int] = mapped_column(nullable=False, index=True)
|
|
status: Mapped[str] = mapped_column(String, nullable=False)
|
|
created_at: Mapped[datetime] = mapped_column(
|
|
DateTime,
|
|
server_default=text('CURRENT_TIMESTAMP'),
|
|
nullable=False,
|
|
)
|
|
updated_at: Mapped[datetime] = mapped_column(
|
|
DateTime,
|
|
server_default=text('CURRENT_TIMESTAMP'),
|
|
onupdate=text('CURRENT_TIMESTAMP'),
|
|
nullable=False,
|
|
)
|