HostMetric migration

This commit is contained in:
Martin Slemr
2023-02-27 11:25:09 +01:00
parent 9f83220f24
commit 581460e854
4 changed files with 4 additions and 5 deletions

View File

@@ -3,7 +3,6 @@
# Python # Python
import dateutil import dateutil
import datetime
import functools import functools
import html import html
import itertools import itertools

View File

@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='hostmetric', model_name='hostmetric',
name='automated_counter', name='automated_counter',
field=models.IntegerField(default=0, help_text='How many times was the host automated'), field=models.BigIntegerField(default=0, help_text='How many times was the host automated'),
), ),
migrations.AddField( migrations.AddField(
model_name='hostmetric', model_name='hostmetric',

View File

@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField(unique=True)), ('date', models.DateField(unique=True)),
('license_consumed', models.BigIntegerField(default=0, help_text='How much unique hosts are consumed from the license')), ('license_consumed', models.BigIntegerField(default=0, help_text='How many unique hosts are consumed from the license')),
('license_capacity', models.BigIntegerField(default=0, help_text="'License capacity as max. number of unique hosts")), ('license_capacity', models.BigIntegerField(default=0, help_text="'License capacity as max. number of unique hosts")),
( (
'hosts_added', 'hosts_added',

View File

@@ -824,7 +824,7 @@ class HostMetric(models.Model):
first_automation = models.DateTimeField(auto_now_add=True, null=False, db_index=True, help_text=_('When the host was first automated against')) first_automation = models.DateTimeField(auto_now_add=True, null=False, db_index=True, help_text=_('When the host was first automated against'))
last_automation = models.DateTimeField(db_index=True, help_text=_('When the host was last automated against')) last_automation = models.DateTimeField(db_index=True, help_text=_('When the host was last automated against'))
last_deleted = models.DateTimeField(null=True, db_index=True, help_text=_('When the host was last deleted')) last_deleted = models.DateTimeField(null=True, db_index=True, help_text=_('When the host was last deleted'))
automated_counter = models.IntegerField(default=0, help_text=_('How many times was the host automated')) automated_counter = models.BigIntegerField(default=0, help_text=_('How many times was the host automated'))
deleted_counter = models.IntegerField(default=0, help_text=_('How many times was the host deleted')) deleted_counter = models.IntegerField(default=0, help_text=_('How many times was the host deleted'))
deleted = models.BooleanField( deleted = models.BooleanField(
default=False, help_text=_('Boolean flag saying whether the host is deleted and therefore not counted into the subscription consumption') default=False, help_text=_('Boolean flag saying whether the host is deleted and therefore not counted into the subscription consumption')
@@ -856,7 +856,7 @@ class HostMetricSummaryMonthly(models.Model):
""" """
date = models.DateField(unique=True) date = models.DateField(unique=True)
license_consumed = models.BigIntegerField(default=0, help_text=_("How much unique hosts are consumed from the license")) license_consumed = models.BigIntegerField(default=0, help_text=_("How many unique hosts are consumed from the license"))
license_capacity = models.BigIntegerField(default=0, help_text=_("'License capacity as max. number of unique hosts")) license_capacity = models.BigIntegerField(default=0, help_text=_("'License capacity as max. number of unique hosts"))
hosts_added = models.IntegerField(default=0, help_text=_("How many hosts were added in the associated month, consuming more license capacity")) hosts_added = models.IntegerField(default=0, help_text=_("How many hosts were added in the associated month, consuming more license capacity"))
hosts_deleted = models.IntegerField(default=0, help_text=_("How many hosts were deleted in the associated month, freeing the license capacity")) hosts_deleted = models.IntegerField(default=0, help_text=_("How many hosts were deleted in the associated month, freeing the license capacity"))