관리-도구
편집 파일: 072_add_malware_history_table.py
from time import time import peewee as pw from defence360agent.model.simplification import FilenameField class MalwareHistory(pw.Model): class Meta: db_table = "malware_history" path = FilenameField(null=False) event = pw.CharField(null=False) initiator = pw.CharField(null=False) cause = pw.CharField(null=False) file_owner = pw.CharField(null=True) ctime = pw.IntegerField(null=True, default=lambda: int(time())) def migrate(migrator, database, fake=False, **kwargs): migrator.create_model(MalwareHistory) def rollback(migrator, database, fake=False, **kwargs): MalwareHistory = migrator.orm["malware_history"] migrator.remove_model(MalwareHistory)