feat: split initial social schema migration chain
replace monolithic migration with ordered scripts, include profiles/sessions in migration, and verify full downgrade/upgrade cycle for clean Supabase bootstrap
This commit is contained in:
@@ -8,7 +8,6 @@ from enum import Enum
|
||||
from sqlalchemy import (
|
||||
DateTime,
|
||||
Enum as SqlEnum,
|
||||
ForeignKey,
|
||||
Integer,
|
||||
Numeric,
|
||||
String,
|
||||
@@ -28,18 +27,32 @@ class AgentChatSessionStatus(str, Enum):
|
||||
FAILED = "failed"
|
||||
|
||||
|
||||
class SessionType(str, Enum):
|
||||
CHAT = "chat"
|
||||
AUTOMATION = "automation"
|
||||
|
||||
|
||||
class AgentChatSession(TimestampMixin, SoftDeleteMixin, Base):
|
||||
__tablename__: str = "sessions"
|
||||
__table_args__ = {"extend_existing": True}
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True), primary_key=True, default=uuid.uuid4
|
||||
)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
ForeignKey("auth.users.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
session_type: Mapped[SessionType] = mapped_column(
|
||||
String(20),
|
||||
nullable=False,
|
||||
default=SessionType.CHAT,
|
||||
)
|
||||
job_id: Mapped[uuid.UUID | None] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
nullable=True,
|
||||
)
|
||||
title: Mapped[str | None] = mapped_column(String(255), nullable=True)
|
||||
status: Mapped[AgentChatSessionStatus] = mapped_column(
|
||||
SqlEnum(
|
||||
|
||||
Reference in New Issue
Block a user