feat: Improve file display, timezone handling, and LOT management
Changes: - Fix datetime serialization with UTC 'Z' suffix for correct timezone display - Add PDF upload support with extension fallback for MIME detection - Fix LOT add/remove by creating new list for SQLAlchemy JSON change detection - Add file message components (FileMessage, ImageLightbox, UploadPreview) - Add multi-file upload support with progress tracking - Link uploaded files to chat messages via message_id - Include file attachments in AI report generation - Update specs for file-storage, realtime-messaging, and ai-report-generation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
"""add message_id to room_files
|
||||
|
||||
Revision ID: a1b2c3d4e5f6
|
||||
Revises: 4c5eb6e941db
|
||||
Create Date: 2025-12-08 12:00:00.000000
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a1b2c3d4e5f6'
|
||||
down_revision = '4c5eb6e941db'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Add message_id column to tr_room_files table
|
||||
op.add_column('tr_room_files', sa.Column('message_id', sa.String(36), nullable=True))
|
||||
|
||||
# Add foreign key constraint
|
||||
op.create_foreign_key(
|
||||
'fk_room_files_message_id',
|
||||
'tr_room_files',
|
||||
'tr_messages',
|
||||
['message_id'],
|
||||
['message_id'],
|
||||
ondelete='SET NULL'
|
||||
)
|
||||
|
||||
# Add index for message_id
|
||||
op.create_index('ix_tr_room_files_message', 'tr_room_files', ['message_id'])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# Remove index
|
||||
op.drop_index('ix_tr_room_files_message', table_name='tr_room_files')
|
||||
|
||||
# Remove foreign key constraint
|
||||
op.drop_constraint('fk_room_files_message_id', 'tr_room_files', type_='foreignkey')
|
||||
|
||||
# Remove column
|
||||
op.drop_column('tr_room_files', 'message_id')
|
||||
Reference in New Issue
Block a user