# 添加创建/更新时间
This commit is contained in:
parent
9cd564d9da
commit
39307f3fe8
|
@ -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='更新时间'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -62,6 +62,8 @@ class DevicePostStatistic(models.Model):
|
||||||
org = models.ForeignKey('Org', verbose_name='所在组织', on_delete='PROTECT')
|
org = models.ForeignKey('Org', verbose_name='所在组织', on_delete='PROTECT')
|
||||||
total = models.PositiveIntegerField(verbose_name='总数')
|
total = models.PositiveIntegerField(verbose_name='总数')
|
||||||
date = models.DateField(auto_now_add=False, verbose_name='日期', unique=False)
|
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:
|
class Meta:
|
||||||
verbose_name = '设备日志统计表'
|
verbose_name = '设备日志统计表'
|
||||||
|
|
Loading…
Reference in New Issue