Skip to content

Commit

Permalink
Fixes #15605: Account for older sequence name in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Apr 10, 2024
1 parent c7f6c20 commit 89453a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netbox/extras/migrations/0111_rename_content_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class Migration(migrations.Migration):
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"
"ALTER TABLE IF EXISTS extras_customfield_content_types_id_seq RENAME TO extras_customfield_object_types_id_seq"
),
# Pre-v2.10 sequence name (see #15605)
migrations.RunSQL(
"ALTER TABLE IF EXISTS extras_customfield_obj_type_id_seq RENAME TO extras_customfield_object_types_id_seq"
),

# Custom links
Expand Down

0 comments on commit 89453a4

Please sign in to comment.