39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
"""persist provider configuration
|
|
|
|
Revision ID: 0006
|
|
Revises: 0005
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = "0006"
|
|
down_revision = "0005"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_table(
|
|
"provider_configs",
|
|
sa.Column("id", sa.Integer(), primary_key=True),
|
|
sa.Column("profile_type", sa.String(32), nullable=False),
|
|
sa.Column("model_name", sa.String(255), nullable=False),
|
|
sa.Column("endpoint", sa.String(1024), nullable=False),
|
|
sa.Column("chat_path", sa.String(255), nullable=False),
|
|
sa.Column("models_path", sa.String(255), nullable=False),
|
|
sa.Column("auth_type", sa.String(32), nullable=False),
|
|
sa.Column("api_key", sa.Text(), nullable=False),
|
|
sa.Column("auth_header", sa.String(255), nullable=False),
|
|
sa.Column("auth_prefix", sa.String(255), nullable=False),
|
|
sa.Column("verify_ssl", sa.Boolean(), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
|
sa.UniqueConstraint("profile_type"),
|
|
)
|
|
op.create_index("ix_provider_configs_profile_type", "provider_configs", ["profile_type"])
|
|
|
|
|
|
def downgrade():
|
|
op.drop_index("ix_provider_configs_profile_type", table_name="provider_configs")
|
|
op.drop_table("provider_configs")
|