feat(itam): History Model migrations for Device Type

ref: #605 #620
This commit is contained in:
2025-02-16 23:09:03 +09:30
parent fa0a81e835
commit 1173029981
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# Generated by Django 5.1.5 on 2025-02-16 13:36
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0018_ticketcommentcategoryhistory'),
('itam', '0013_deviceoperatingsystemhistory'),
]
operations = [
migrations.CreateModel(
name='DeviceTypeHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='itam.devicetype', verbose_name='Model')),
],
options={
'verbose_name': 'Device Type History',
'verbose_name_plural': 'Device TYpe History',
'db_table': 'itam_devicetype_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
]

View File

@ -2,6 +2,8 @@ from drf_spectacular.utils import extend_schema, extend_schema_view, OpenApiResp
from api.viewsets.common import ModelViewSet from api.viewsets.common import ModelViewSet
# THis import only exists so that the migrations can be created
from itam.models.device_type_history import DeviceTypeHistory # pylint: disable=W0611:unused-import
from itam.serializers.device_type import ( from itam.serializers.device_type import (
DeviceType, DeviceType,
DeviceTypeModelSerializer, DeviceTypeModelSerializer,