fix: 6 integration audit fixes — ticket filter, admin nav, FK scope, debounce, error messages
- Fix AISession.ticket_id → psa_ticket_id in list_sessions filter query - Add Gallery nav item (LayoutGrid icon) to AdminSidebar navItems array - Remove ForeignKey from FileUpload.session_id (Python model) + migration b8d2f4a6c091 to drop DB constraint, allowing column to reference either session type - Add 400ms debounce on AI session search input in SessionHistoryPage (aiSearchInput state + useRef timeout pattern) - Show friendly 503 error message in RichTextInput upload error handler (both initial upload and retry paths) - Add overflow-x-auto to FlowPilotAnalyticsPage tab bar container Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""drop file_uploads session_id foreign key constraint
|
||||
|
||||
Revision ID: b8d2f4a6c091
|
||||
Revises: a7c9e3b1f402
|
||||
Create Date: 2026-03-20 00:00:00.000000
|
||||
|
||||
The session_id column on file_uploads previously referenced ai_sessions.id.
|
||||
Removing the FK allows the column to reference either AI sessions or regular
|
||||
sessions without a constraint violation, while keeping the index for query
|
||||
performance.
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'b8d2f4a6c091'
|
||||
down_revision: Union[str, None] = 'a7c9e3b1f402'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_constraint('file_uploads_session_id_fkey', 'file_uploads', type_='foreignkey')
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.create_foreign_key(
|
||||
'file_uploads_session_id_fkey',
|
||||
'file_uploads', 'ai_sessions',
|
||||
['session_id'], ['id'],
|
||||
ondelete='SET NULL',
|
||||
)
|
||||
Reference in New Issue
Block a user