Coverage for src/backend/InvenTree/common/migrations/0044_notificationmessage_charfield_pk.py: 100%
4 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
1"""Migration to change NotificationMessage object_id fields from PositiveIntegerField to CharField.
3This allows notifications to reference models that use non-integer primary keys,
4such as UUIDField (e.g. MachineConfig), without a database overflow error.
6See: https://github.com/inventree/InvenTree/issues/12131
7"""
9from django.db import migrations, models
12class Migration(migrations.Migration):
14 dependencies = [
15 ('common', '0043_auto_20260518_1206'),
16 ]
18 operations = [
19 migrations.AlterField(
20 model_name='notificationmessage',
21 name='target_object_id',
22 field=models.CharField(max_length=255),
23 ),
24 migrations.AlterField(
25 model_name='notificationmessage',
26 name='source_object_id',
27 field=models.CharField(max_length=255, null=True, blank=True),
28 ),
29 ]