models.py
from django.dbimport models
class BackupInfo(models.Model):
group_name = models.CharField(max_length=50, null=False, default='',)
group_id = models.CharField(max_length=40, null=False, default='0',)
project_name = models.CharField(max_length=50, null=False, default='',)
project_id = models.CharField(max_length=40, null=False, default='0',)
task_id = models.CharField(max_length=40, null=False, default='0',)
begin_time = models.DateTimeField()
cost_time = models.FloatField()
backup_policy = models.CharField(max_length=50, null=False, default='实例备份')
file_size = models.BigIntegerField()
method = models.CharField(max_length=50, null=False, default='物理备份')
type = models.CharField(max_length=20, null=False,default='full')
status = models.CharField(max_length=10, null=False,default='full')
create_time = models.DateTimeField(auto_now=True)
update_time = models.DateTimeField(auto_now_add=True)
del_flag = models.IntegerField(null=False, default=0)
class Meta:
# 数据库备份信息表
db_table ="db_backup_info"
ordering = ['-create_time']
class BackupLog(models.Model):
project_name = models.CharField(max_length=50,null=False, default='')
task_id = models.CharField(max_length=40, null=False, default='0', )
task_log = models.TextField()
create_time = models.DateTimeField(auto_now=True)
update_time = models.DateTimeField(auto_now_add=True)
del_flag = models.IntegerField(null=False, default=0)
class Meta:
# 数据库备份日志表
db_table ="db_backup_log"
ordering = ['-create_time']
class RecoveryInfo(models.Model):
group_name = models.CharField(max_length=50, null=False, default='',)
group_id = models.CharField(max_length=40, null=False, default='0',)
project_name = models.CharField(max_length=50, null=False, default='',)
project_id = models.CharField(max_length=40, null=False, default='0',)
task_id = models.CharField(max_length=40, null=False, default='0',)
begin_time = models.DateTimeField()
cost_time = models.FloatField()
status = models.CharField(max_length=10, null=False,default='full')
create_time = models.DateTimeField(auto_now=True)
update_time = models.DateTimeField(auto_now_add=True)
del_flag = models.IntegerField(null=False, default=0)
class Meta:
# 数据库恢复信息表
db_table ="db_recovery_info"
ordering = ['-create_time']
class RecoveryLog(models.Model):
project_name = models.CharField(max_length=50,null=False, default='')
task_id = models.CharField(max_length=40, null=False, default='0', )
task_log = models.TextField()
create_time = models.DateTimeField(auto_now=True)
update_time = models.DateTimeField(auto_now_add=True)
del_flag = models.IntegerField(null=False, default=0)
class Meta:
# 数据库恢复日志表
db_table ="db_recovery_log"
ordering = ['-create_time']
网友评论