refactor: improve transcript list performance (#480)

* refactor: improve transcript list performance

* fix: sync openapi

* fix: frontend types

* fix: remove drop table _alembic_tmp_meeting

* fix: remove create table too

* fix: remove uq_recording_object_key
This commit is contained in:
2025-07-15 15:10:05 -06:00
committed by GitHub
parent 3d370336cc
commit 9deb717e5b
21 changed files with 470 additions and 126 deletions

View File

@@ -0,0 +1,59 @@
"""add_performance_indexes
Revision ID: ccd68dc784ff
Revises: 20250618140000
Create Date: 2025-07-15 11:48:42.854741
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "ccd68dc784ff"
down_revision: Union[str, None] = "20250618140000"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("meeting", schema=None) as batch_op:
batch_op.create_index("idx_meeting_room_id", ["room_id"], unique=False)
with op.batch_alter_table("recording", schema=None) as batch_op:
batch_op.create_index("idx_recording_meeting_id", ["meeting_id"], unique=False)
with op.batch_alter_table("room", schema=None) as batch_op:
batch_op.create_index("idx_room_is_shared", ["is_shared"], unique=False)
with op.batch_alter_table("transcript", schema=None) as batch_op:
batch_op.create_index("idx_transcript_created_at", ["created_at"], unique=False)
batch_op.create_index(
"idx_transcript_recording_id", ["recording_id"], unique=False
)
batch_op.create_index("idx_transcript_user_id", ["user_id"], unique=False)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("transcript", schema=None) as batch_op:
batch_op.drop_index("idx_transcript_user_id")
batch_op.drop_index("idx_transcript_recording_id")
batch_op.drop_index("idx_transcript_created_at")
with op.batch_alter_table("room", schema=None) as batch_op:
batch_op.drop_index("idx_room_is_shared")
with op.batch_alter_table("recording", schema=None) as batch_op:
batch_op.drop_index("idx_recording_meeting_id")
with op.batch_alter_table("meeting", schema=None) as batch_op:
batch_op.drop_index("idx_meeting_room_id")
# ### end Alembic commands ###