"""Peewee migrations -- 193_MAIN.py.

Add ``Contract.create_taxdocument`` -- a per-contract default for the
"Issue tax document" checkbox. New contracts are pre-set from the global
``Setup.create_taxdocument`` but can be flipped per contract.
"""

import peewee as pw
from peewee_migrate import Migrator


def migrate(migrator: Migrator, database: pw.Database, *, fake: bool = False) -> None:
    migrator.add_fields(
        'contract',
        create_taxdocument=pw.BooleanField(default=True))


def rollback(migrator: Migrator, database: pw.Database, *, fake: bool = False) -> None:
    migrator.remove_fields('contract', 'create_taxdocument')
