# 添加创建/更新时间

This commit is contained in:
xianfuxing 2020-06-01 17:35:10 +08:00
parent 9cd564d9da
commit 39307f3fe8
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 2.2.4 on 2020-06-01 08:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mosquito', '0013_deviceinfo_device_name'),
]
operations = [
migrations.AddField(
model_name='devicepoststatistic',
name='create_time',
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='创建时间'),
),
migrations.AddField(
model_name='devicepoststatistic',
name='update_time',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='更新时间'),
),
]

View File

@ -62,6 +62,8 @@ class DevicePostStatistic(models.Model):
org = models.ForeignKey('Org', verbose_name='所在组织', on_delete='PROTECT')
total = models.PositiveIntegerField(verbose_name='总数')
date = models.DateField(auto_now_add=False, verbose_name='日期', unique=False)
create_time = models.DateTimeField(auto_now_add=True, blank=True, null=True, verbose_name='创建时间')
update_time = models.DateTimeField(auto_now=True, blank=True, null=True, verbose_name='更新时间')
class Meta:
verbose_name = '设备日志统计表'