Skip to content

Commit 3967df0

Browse files
authored
Create 6b27af76a38a_one_running_run_per_conversation.py
1 parent 2193e55 commit 3967df0

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""one running run per conversation
2+
3+
Revision ID: 6b27af76a38a
4+
Revises: 29f302f66e10
5+
Create Date: 2026-09-24 08:45:15.111435
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = '6b27af76a38a'
16+
down_revision: Union[str, Sequence[str], None] = '29f302f66e10'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
"""Upgrade schema."""
23+
# ### commands auto generated by Alembic - please adjust! ###
24+
with op.batch_alter_table('runs', schema=None) as batch_op:
25+
batch_op.create_index('uq_one_running_run_per_conversation', ['conversation_id'], unique=True, sqlite_where=sa.text("status = 'running'"), postgresql_where=sa.text("status = 'running'"))
26+
27+
# ### end Alembic commands ###
28+
29+
30+
def downgrade() -> None:
31+
"""Downgrade schema."""
32+
# ### commands auto generated by Alembic - please adjust! ###
33+
with op.batch_alter_table('runs', schema=None) as batch_op:
34+
batch_op.drop_index('uq_one_running_run_per_conversation', sqlite_where=sa.text("status = 'running'"), postgresql_where=sa.text("status = 'running'"))
35+
36+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)