Source code for tcms.management.migrations.0011_history_for_product_version_build

# Generated by Django 5.2.6 on 2025-09-22 11:39

import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


[docs] class Migration(migrations.Migration): dependencies = [ ("management", "0010_alter_meta"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="HistoricalBuild", fields=[ ( "id", models.IntegerField( auto_created=True, blank=True, db_index=True, verbose_name="ID" ), ), ("name", models.CharField(max_length=255)), ("is_active", models.BooleanField(default=True)), ("history_id", models.AutoField(primary_key=True, serialize=False)), ("history_date", models.DateTimeField(db_index=True)), ("history_change_reason", models.TextField(null=True)), ( "history_type", models.CharField( choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1, ), ), ( "history_user", models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to=settings.AUTH_USER_MODEL, ), ), ( "version", models.ForeignKey( blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="management.version", ), ), ], options={ "verbose_name": "historical Build", "verbose_name_plural": "historical Builds", "ordering": ("-history_date", "-history_id"), "get_latest_by": ("history_date", "history_id"), }, bases=(simple_history.models.HistoricalChanges, models.Model), ), migrations.CreateModel( name="HistoricalProduct", fields=[ ( "id", models.IntegerField( auto_created=True, blank=True, db_index=True, verbose_name="ID" ), ), ("name", models.CharField(db_index=True, max_length=255)), ("description", models.TextField(blank=True)), ("history_id", models.AutoField(primary_key=True, serialize=False)), ("history_date", models.DateTimeField(db_index=True)), ("history_change_reason", models.TextField(null=True)), ( "history_type", models.CharField( choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1, ), ), ( "classification", models.ForeignKey( blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="management.classification", ), ), ( "history_user", models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to=settings.AUTH_USER_MODEL, ), ), ], options={ "verbose_name": "historical product", "verbose_name_plural": "historical products", "ordering": ("-history_date", "-history_id"), "get_latest_by": ("history_date", "history_id"), }, bases=(simple_history.models.HistoricalChanges, models.Model), ), migrations.CreateModel( name="HistoricalVersion", fields=[ ( "id", models.IntegerField( auto_created=True, blank=True, db_index=True, verbose_name="ID" ), ), ("value", models.CharField(max_length=192)), ("history_id", models.AutoField(primary_key=True, serialize=False)), ("history_date", models.DateTimeField(db_index=True)), ("history_change_reason", models.TextField(null=True)), ( "history_type", models.CharField( choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1, ), ), ( "history_user", models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to=settings.AUTH_USER_MODEL, ), ), ( "product", models.ForeignKey( blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="management.product", ), ), ], options={ "verbose_name": "historical version", "verbose_name_plural": "historical versions", "ordering": ("-history_date", "-history_id"), "get_latest_by": ("history_date", "history_id"), }, bases=(simple_history.models.HistoricalChanges, models.Model), ), ]