"""Peewee migrations -- 192_MAIN.py.

Add ``Setup.create_taxdocument`` -- controls whether the "Issue tax
document" checkbox on the order-submit form starts checked.
"""

import peewee as pw
from peewee_migrate import Migrator


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


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