feat(itam): History Model migrations for Device Operating System
ref: #605 #618
This commit is contained in:
28
app/itam/migrations/0013_deviceoperatingsystemhistory.py
Normal file
28
app/itam/migrations/0013_deviceoperatingsystemhistory.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 5.1.5 on 2025-02-16 13:30
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('itam', '0012_alter_devicesoftwarehistory_table_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='DeviceOperatingSystemHistory',
|
||||
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.deviceoperatingsystem', verbose_name='Model')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Device Operating System History',
|
||||
'verbose_name_plural': 'Device Operating System History',
|
||||
'db_table': 'itam_deviceoperatingsystem_history',
|
||||
'ordering': ['-created'],
|
||||
},
|
||||
bases=('itam.devicehistory',),
|
||||
),
|
||||
]
|
@ -16,6 +16,8 @@ from api.views.mixin import OrganizationPermissionAPI
|
||||
|
||||
from api.viewsets.common import ModelViewSet
|
||||
|
||||
# THis import only exists so that the migrations can be created
|
||||
from itam.models.device_operating_system_history import DeviceOperatingSystemHistory # pylint: disable=W0611:unused-import
|
||||
from itam.serializers.device_operating_system import (
|
||||
Device,
|
||||
DeviceOperatingSystem,
|
||||
|
Reference in New Issue
Block a user