"""Integration of ansible inventory in main database

Revision ID: 2be1e584707d
Revises: 740850a52979
Create Date: 2024-07-01 19:07:11.597036

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2be1e584707d'
down_revision = '740850a52979'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('worker', schema=None) as batch_op:
        batch_op.add_column(sa.Column('ipv4', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('ipv6', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('ansible_host', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('ansible_group', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('ansible_active', sa.Boolean(), server_default="0"))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('worker', schema=None) as batch_op:
        batch_op.drop_column('ansible_active')
        batch_op.drop_column('ansible_group')
        batch_op.drop_column('ansible_host')
        batch_op.drop_column('ipv6')
        batch_op.drop_column('ipv4')

    # ### end Alembic commands ###
