47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
"""empty message
|
|
|
|
Revision ID: a7e21164c990
|
|
Revises:
|
|
Create Date: 2026-07-07 15:00:23.572644
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlmodel
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'a7e21164c990'
|
|
down_revision: Union[str, Sequence[str], None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('messagehistory',
|
|
sa.Column('id', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.Column('conversation_id', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.Column('run_id', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.Column('new_message', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
with op.batch_alter_table('messagehistory', schema=None) as batch_op:
|
|
batch_op.create_index(batch_op.f('ix_messagehistory_conversation_id'), ['conversation_id'], unique=False)
|
|
batch_op.create_index(batch_op.f('ix_messagehistory_run_id'), ['run_id'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('messagehistory', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_messagehistory_run_id'))
|
|
batch_op.drop_index(batch_op.f('ix_messagehistory_conversation_id'))
|
|
|
|
op.drop_table('messagehistory')
|
|
# ### end Alembic commands ###
|