"""Change Account fee columns

Revision ID: 24eb2507aa2e
Revises: 806a7aac6884
Create Date: 2024-09-04 16:18:55.948273

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "24eb2507aa2e"
down_revision = "0c4fde7a00b3"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "accounts",
        "platform_subscription_fee_percent",
        new_column_name="platform_fee_percent",
    )
    op.add_column(
        "accounts", sa.Column("platform_fee_fixed", sa.Integer(), nullable=True)
    )
    op.drop_column("accounts", "platform_pledge_fee_percent")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "accounts",
        sa.Column(
            "platform_pledge_fee_percent",
            sa.INTEGER(),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.drop_column("accounts", "platform_fee_fixed")
    op.alter_column(
        "accounts",
        "platform_fee_percent",
        new_column_name="platform_subscription_fee_percent",
    )
    # ### end Alembic commands ###
