PERMANENT_TTL = 0


def migrate(migrator, database, fake=False, **kwargs):
    IPListModel = migrator.orm["iplist"]

    IPListModel.update(expiration=PERMANENT_TTL).where(
        (IPListModel.listname == "BLACK")
        & (IPListModel.expiration != PERMANENT_TTL)
    ).execute()


def rollback(migrator, database, fake=False, **kwargs):
    pass
