"""Peewee migrations -- 185_MAIN.py.

Drop ``NOT NULL`` from ``taxdocument.customer_record``: per Czech law the
customer is not mandatory on receipts under the threshold, so the field must
be optional.
"""

import peewee as pw
from peewee_migrate import Migrator


def migrate(migrator: Migrator, database: pw.Database, *, fake: bool = False) -> None:
    migrator.drop_not_null("taxdocument", "customer_record")


def rollback(migrator: Migrator, database: pw.Database, *, fake: bool = False) -> None:
    migrator.add_not_null("taxdocument", "customer_record")
