"""Add last_monitored and enabled to MonitorConfig

Revision ID: 4fb779cc5f17
Revises: 8976def679db
Create Date: 2024-06-21 13:45:46.024496

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "4fb779cc5f17"
down_revision = "8976def679db"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "monitorconfig",
        sa.Column("last_monitored", sa.DateTime(timezone=True), nullable=True),
    )
    op.add_column(
        "monitorconfig",
        sa.Column("enabled", sa.Boolean(), nullable=False, server_default="t"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("monitorconfig", "enabled")
    op.drop_column("monitorconfig", "last_monitored")
    # ### end Alembic commands ###
