fix: add cloudonix CDR handling (#140)

* feat: add cloudonix cdr

* fix: remove org check

---------

Co-authored-by: Sabiha Khan <sabihak89@gmail.com>
This commit is contained in:
Abhishek 2026-01-29 19:06:52 +05:30 committed by GitHub
parent 91911769b0
commit b1c982a52e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 179 additions and 10 deletions

View file

@ -0,0 +1,46 @@
"""add partial index on call_id for workflow run
Revision ID: d1dac4c93e61
Revises: 181475b2a1a1
Create Date: 2026-01-29 16:28:04.105202
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "d1dac4c93e61"
down_revision: Union[str, None] = "181475b2a1a1"
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! ###
op.drop_index(op.f("ix_api_keys_key_hash"), table_name="api_keys")
op.create_index(op.f("ix_api_keys_key_hash"), "api_keys", ["key_hash"], unique=True)
op.create_index(
"idx_workflow_runs_call_id",
"workflow_runs",
[sa.literal_column("(gathered_context->>'call_id')")],
unique=False,
postgresql_where=sa.text("gathered_context->>'call_id' IS NOT NULL"),
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(
"idx_workflow_runs_call_id",
table_name="workflow_runs",
postgresql_where=sa.text("gathered_context->>'call_id' IS NOT NULL"),
)
op.drop_index(op.f("ix_api_keys_key_hash"), table_name="api_keys")
op.create_index(
op.f("ix_api_keys_key_hash"), "api_keys", ["key_hash"], unique=False
)
# ### end Alembic commands ###