update clean embedding cache query logic (#6483)

This commit is contained in:
Jyong 2024-07-20 01:29:25 +08:00 committed by GitHub
commit 1e0e573165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 6 deletions

View file

@ -630,7 +630,8 @@ class Embedding(db.Model):
__tablename__ = 'embeddings'
__table_args__ = (
db.PrimaryKeyConstraint('id', name='embedding_pkey'),
db.UniqueConstraint('model_name', 'hash', 'provider_name', name='embedding_hash_idx')
db.UniqueConstraint('model_name', 'hash', 'provider_name', name='embedding_hash_idx'),
db.Index('created_at_idx', 'created_at')
)
id = db.Column(StringUUID, primary_key=True, server_default=db.text('uuid_generate_v4()'))

View file

@ -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()'))