feat(itam): History Model migrations for Device Software

ref: #605 #619
This commit is contained in:
2025-02-16 22:50:56 +09:30
parent 86116f4563
commit 08a3042866
3 changed files with 30 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class ModelHistory(
child_history_models = [
'configgrouphostshistory',
'configgroupsoftwarehistory',
'devicesoftwarehistory'
]
"""Child History Models

View File

@ -0,0 +1,28 @@
# Generated by Django 5.1.5 on 2025-02-15 20:40
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('itam', '0009_devicehistory'),
]
operations = [
migrations.CreateModel(
name='DeviceSoftwareHistory',
fields=[
('devicehistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='itam.devicehistory')),
('child_model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='itam.devicesoftware', verbose_name='Model')),
],
options={
'verbose_name': 'Device Software History',
'verbose_name_plural': 'Device Software History',
'db_table': 'itam_device_software_history',
'ordering': ['-created'],
},
bases=('itam.devicehistory',),
),
]

View File

@ -0,0 +1 @@
from .device_software_history import DeviceSoftwareHistory