"""Add applications.isrequired

Backs the software-compliance report, which compares required applications
against what is installed per PC. There was no such flag before, so the report
errored.

Revision ID: 7c02_app_isrequired
Revises: 7c01_drop_legacy_machine
Create Date: 2026-06-26

"""
from alembic import op
import sqlalchemy as sa


revision = '7c02_app_isrequired'
down_revision = '7c01_drop_legacy_machine'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('applications', sa.Column(
        'isrequired', sa.Boolean(), nullable=True, server_default=sa.false(),
        comment='Required on all PCs (drives the software-compliance report)'))


def downgrade():
    op.drop_column('applications', 'isrequired')
