Browse Source

Rename sequences for ObjectType M2M tables

Jeremy Stretch 2 years ago
parent
commit
4533c8dae0
1 changed files with 15 additions and 0 deletions
  1. 15 0
      netbox/extras/migrations/0111_rename_content_types.py

+ 15 - 0
netbox/extras/migrations/0111_rename_content_types.py

@@ -26,6 +26,9 @@ class Migration(migrations.Migration):
             name='object_type',
             name='object_type',
             field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.objecttype'),
             field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.objecttype'),
         ),
         ),
+        migrations.RunSQL(
+            "ALTER TABLE extras_customfield_content_types_id_seq RENAME TO extras_customfield_object_types_id_seq"
+        ),
 
 
         # Custom links
         # Custom links
         migrations.RenameField(
         migrations.RenameField(
@@ -38,6 +41,9 @@ class Migration(migrations.Migration):
             name='object_types',
             name='object_types',
             field=models.ManyToManyField(related_name='custom_links', to='core.objecttype'),
             field=models.ManyToManyField(related_name='custom_links', to='core.objecttype'),
         ),
         ),
+        migrations.RunSQL(
+            "ALTER TABLE extras_customlink_content_types_id_seq RENAME TO extras_customlink_object_types_id_seq"
+        ),
 
 
         # Event rules
         # Event rules
         migrations.RenameField(
         migrations.RenameField(
@@ -50,6 +56,9 @@ class Migration(migrations.Migration):
             name='object_types',
             name='object_types',
             field=models.ManyToManyField(related_name='event_rules', to='core.objecttype'),
             field=models.ManyToManyField(related_name='event_rules', to='core.objecttype'),
         ),
         ),
+        migrations.RunSQL(
+            "ALTER TABLE extras_eventrule_content_types_id_seq RENAME TO extras_eventrule_object_types_id_seq"
+        ),
 
 
         # Export templates
         # Export templates
         migrations.RenameField(
         migrations.RenameField(
@@ -62,6 +71,9 @@ class Migration(migrations.Migration):
             name='object_types',
             name='object_types',
             field=models.ManyToManyField(related_name='export_templates', to='core.objecttype'),
             field=models.ManyToManyField(related_name='export_templates', to='core.objecttype'),
         ),
         ),
+        migrations.RunSQL(
+            "ALTER TABLE extras_exporttemplate_content_types_id_seq RENAME TO extras_exporttemplate_object_types_id_seq"
+        ),
 
 
         # Saved filters
         # Saved filters
         migrations.RenameField(
         migrations.RenameField(
@@ -74,6 +86,9 @@ class Migration(migrations.Migration):
             name='object_types',
             name='object_types',
             field=models.ManyToManyField(related_name='saved_filters', to='core.objecttype'),
             field=models.ManyToManyField(related_name='saved_filters', to='core.objecttype'),
         ),
         ),
+        migrations.RunSQL(
+            "ALTER TABLE extras_savedfilter_content_types_id_seq RENAME TO extras_savedfilter_object_types_id_seq"
+        ),
 
 
         # Image attachments
         # Image attachments
         migrations.RemoveIndex(
         migrations.RemoveIndex(