34 lines
933 B
Python
34 lines
933 B
Python
"""代理白名单平台抽象:新增 whitelist_platform / whitelist_credentials 字段
|
|
|
|
Revision ID: 20260624_0003
|
|
Revises: 20260624_0002
|
|
Create Date: 2026-06-24
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision: str = "20260624_0003"
|
|
down_revision: Union[str, None] = "20260624_0002"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("proxy_config") as batch:
|
|
batch.add_column(
|
|
sa.Column("whitelist_platform", sa.String(32), server_default="xiequ")
|
|
)
|
|
batch.add_column(
|
|
sa.Column("whitelist_credentials", sa.JSON(), nullable=True)
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("proxy_config") as batch:
|
|
batch.drop_column("whitelist_credentials")
|
|
batch.drop_column("whitelist_platform")
|