Open SwaroopGiri opened 3 weeks ago
After spending a few days on this, I checked 0111_rename_content_types.py file and saw that the migration tries to rename relations twice to the same name which leads to duplicate error. After commenting below code in "0111_rename_content_types.py" The upgrade went through but I'm unsure if this is the correct solution.
# 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"
# ),
The upgrade path I followed was v3.2.1 --> v3.7.8 --> v4.0.5
Looks like a potential edge case from older installs, I'm guessing there should probably be a check if extras_customfield_object_types_id_seq already exists then skip the second ALTER TABLE in the below code from 0111_rename_content_types.py
migrations.RunSQL(
"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"
),
Is there a fix for this yet - for the docker version? The netbox process exit's when hitting this in v4.0-2.9.0 or v4.0-2.9.1 when upgrading from v3.7-2.8.0 from an old upgrade starting from v2.10.8.
The first ALTER TABLE command works on the database but the netbox DB migrations runs the second one.
Deployment Type
Self-hosted
NetBox Version
v3.7.8
Python Version
3.12
Steps to Reproduce
Expected Behavior
Upgrade complete! Don't forget to restart the NetBox services:
Observed Behavior