33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
"""refactor_global_signature_config
|
|
|
|
Revision ID: 7d7641cc1bb2
|
|
Revises: b3a7c1e9f042
|
|
Create Date: 2026-07-21 07:19:00.000000
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '7d7641cc1bb2'
|
|
down_revision: Union[str, None] = 'af57c3d9f1c2'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column('global_signature_configs', sa.Column('global_credentials_json', postgresql.JSON(astext_type=sa.Text()), nullable=True))
|
|
op.add_column('global_signature_configs', sa.Column('enabled_providers', postgresql.JSON(astext_type=sa.Text()), server_default='["docuseal", "zoho_sign"]', nullable=False))
|
|
op.drop_column('global_signature_configs', 'docuseal_credentials')
|
|
op.drop_column('global_signature_configs', 'zoho_credentials')
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.add_column('global_signature_configs', sa.Column('zoho_credentials', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
|
|
op.add_column('global_signature_configs', sa.Column('docuseal_credentials', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
|
|
op.drop_column('global_signature_configs', 'enabled_providers')
|
|
op.drop_column('global_signature_configs', 'global_credentials_json')
|