feat(itam): History Model migrations for Device Model

ref: #605 #617
This commit is contained in:
2025-02-16 22:48:28 +09:30
parent 4e5d2378d8
commit 6ccb63c921
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:15
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0018_ticketcommentcategoryhistory'),
('itam', '0010_devicesoftwarehistory'),
]
operations = [
migrations.CreateModel(
name='DeviceModelHistory',
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.devicemodel', verbose_name='Model')),
],
options={
'verbose_name': 'Device Model History',
'verbose_name_plural': 'Device Model History',
'db_table': 'itam_devicemodel_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
# THis import only exists so that the migrations can be created
from itam.models.device_model_history import DeviceModelHistory # pylint: disable=W0611:unused-import
from itam.serializers.device_model import (
DeviceModel,
DeviceModelModelSerializer,