"""Peewee migrations -- 176_MAIN.py.

Add can_produce permission field to User model.
"""

import peewee as pw
from peewee_migrate import Migrator


def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
    """Write your migrations here."""

    migrator.add_fields(
        'user',

        can_produce=pw.BooleanField(constraints=[pw.SQL("DEFAULT 1")], default=True, null=True))


def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
    """Write your rollback migrations here."""

    migrator.remove_fields('user', 'can_produce')
