"""Replace ip_address with local_ip and add public_ip

Revision ID: 351386323a79
Revises: 4b74b8a01154
Create Date: 2025-05-28 03:54:33.409642

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '351386323a79'
down_revision = '4b74b8a01154'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('api_logs', schema=None) as batch_op:
        batch_op.add_column(sa.Column('local_ip', sa.String(length=45), nullable=True))
        batch_op.add_column(sa.Column('public_ip', sa.String(length=45), nullable=True))
        batch_op.drop_column('ip_address')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('api_logs', schema=None) as batch_op:
        batch_op.add_column(sa.Column('ip_address', sa.VARCHAR(length=15), nullable=False))
        batch_op.drop_column('public_ip')
        batch_op.drop_column('local_ip')

    # ### end Alembic commands ###
