2024-04-22-17-19_aa4bda3363e3.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. """update models
  2. Revision ID: aa4bda3363e3
  3. Revises: 8dbb8f38ef77
  4. Create Date: 2024-04-22 17:19:59.829072
  5. """
  6. from typing import Sequence, Union
  7. from alembic import op
  8. import sqlalchemy as sa
  9. import sqlmodel
  10. # revision identifiers, used by Alembic.
  11. revision: str = "aa4bda3363e3"
  12. down_revision: Union[str, None] = "8dbb8f38ef77"
  13. branch_labels: Union[str, Sequence[str], None] = None
  14. depends_on: Union[str, Sequence[str], None] = None
  15. def upgrade() -> None:
  16. # ### commands auto generated by Alembic - please adjust! ###
  17. op.add_column("assistant", sa.Column("response_format", sqlmodel.sql.sqltypes.AutoString(), nullable=True))
  18. op.add_column("assistant", sa.Column("tool_resources", sa.JSON(), nullable=True))
  19. op.add_column("assistant", sa.Column("temperature", sa.Float(), nullable=True))
  20. op.add_column("assistant", sa.Column("top_p", sa.Float(), nullable=True))
  21. op.add_column("run", sa.Column("incomplete_details", sqlmodel.sql.sqltypes.AutoString(), nullable=True))
  22. op.add_column("run", sa.Column("max_completion_tokens", sa.Integer(), nullable=True))
  23. op.add_column("run", sa.Column("max_prompt_tokens", sa.Integer(), nullable=True))
  24. op.add_column("run", sa.Column("response_format", sqlmodel.sql.sqltypes.AutoString(), nullable=True))
  25. op.add_column("run", sa.Column("tool_choice", sqlmodel.sql.sqltypes.AutoString(), nullable=True))
  26. op.add_column("run", sa.Column("truncation_strategy", sa.JSON(), nullable=True))
  27. op.add_column("run", sa.Column("usage", sa.JSON(), nullable=True))
  28. op.add_column("run", sa.Column("temperature", sa.Float(), nullable=True))
  29. op.add_column("run", sa.Column("top_p", sa.Float(), nullable=True))
  30. # ### end Alembic commands ###
  31. def downgrade() -> None:
  32. # ### commands auto generated by Alembic - please adjust! ###
  33. op.drop_column("run", "top_p")
  34. op.drop_column("run", "temperature")
  35. op.drop_column("run", "usage")
  36. op.drop_column("run", "truncation_strategy")
  37. op.drop_column("run", "tool_choice")
  38. op.drop_column("run", "response_format")
  39. op.drop_column("run", "max_prompt_tokens")
  40. op.drop_column("run", "max_completion_tokens")
  41. op.drop_column("run", "incomplete_details")
  42. op.drop_column("assistant", "top_p")
  43. op.drop_column("assistant", "temperature")
  44. op.drop_column("assistant", "tool_resources")
  45. op.drop_column("assistant", "response_format")
  46. # ### end Alembic commands ###