Skip to content

Commit

Permalink
add embeddings index created_at
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong committed Jul 19, 2024
1 parent 8f8ad3b commit 049a7ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""add-embedding-cache-created_at_index
Revision ID: 6e957a32015b
Revises: fecff1c3da27
Create Date: 2024-07-19 17:21:34.414705
"""
from alembic import op
import models as models
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6e957a32015b'
down_revision = 'fecff1c3da27'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('embeddings', schema=None) as batch_op:
batch_op.create_index('created_at_idx', ['created_at'], unique=False)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('embeddings', schema=None) as batch_op:
batch_op.drop_index('created_at_idx')

# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion api/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ class TraceAppConfig(db.Model):
__tablename__ = 'trace_app_config'
__table_args__ = (
db.PrimaryKeyConstraint('id', name='tracing_app_config_pkey'),
db.Index('tracing_app_config_app_id_idx', 'app_id'),
db.Index('trace_app_config_app_id_idx', 'app_id'),
)

id = db.Column(StringUUID, server_default=db.text('uuid_generate_v4()'))
Expand Down

0 comments on commit 049a7ac

Please sign in to comment.