Coverage for vendor / migrations / 0007_historicalmodel.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-24 12:43 +0000

1# Generated by Django 6.0.3 on 2026-03-10 07:18 

2 

3import django.db.models.deletion 

4import simple_history.models 

5from django.conf import settings 

6from django.db import migrations, models 

7 

8 

9class Migration(migrations.Migration): 

10 

11 dependencies = [ 

12 ("vendor", "0006_alter_model_options"), 

13 migrations.swappable_dependency(settings.AUTH_USER_MODEL), 

14 ] 

15 

16 operations = [ 

17 migrations.CreateModel( 

18 name="HistoricalModel", 

19 fields=[ 

20 ( 

21 "id", 

22 models.BigIntegerField( 

23 auto_created=True, blank=True, db_index=True, verbose_name="ID" 

24 ), 

25 ), 

26 ("name", models.CharField(db_index=True, max_length=45)), 

27 ("history_id", models.AutoField(primary_key=True, serialize=False)), 

28 ("history_date", models.DateTimeField(db_index=True)), 

29 ("history_change_reason", models.CharField(max_length=100, null=True)), 

30 ( 

31 "history_type", 

32 models.CharField( 

33 choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], 

34 max_length=1, 

35 ), 

36 ), 

37 ( 

38 "history_user", 

39 models.ForeignKey( 

40 null=True, 

41 on_delete=django.db.models.deletion.SET_NULL, 

42 related_name="+", 

43 to=settings.AUTH_USER_MODEL, 

44 ), 

45 ), 

46 ], 

47 options={ 

48 "verbose_name": "historical model", 

49 "verbose_name_plural": "historical models", 

50 "ordering": ("-history_date", "-history_id"), 

51 "get_latest_by": ("history_date", "history_id"), 

52 }, 

53 bases=(simple_history.models.HistoricalChanges, models.Model), 

54 ), 

55 ]