"""
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
"""
import peewee as pw
def migrate(migrator, database, fake=False, **kwargs):
class MRSQueueCounter(pw.Model):
class Meta:
db_table = "mrs_queue_counters"
name = pw.CharField(max_length=64, primary_key=True)
value = pw.IntegerField(default=0)
last_metrics_report_time = pw.IntegerField(null=True)
migrator.create_model(MRSQueueCounter)
def rollback(migrator, database, fake=False, **kwargs):
MRSQueueCounter = migrator.orm["mrs_queue_counters"]
migrator.remove_model(MRSQueueCounter)