nautobot-app-ssot
nautobot-app-ssot copied to clipboard
Installing SSoT App to existing Nautobot 2.1.5 installation fails migrations
Environment
- Python version: 3.9.18
- Nautobot version: 2.1.5
- nautobot-ssot version: 2.5.0
Expected Behavior
Nautobot SSoT App successfully migrate with existing Nautobot 2.1.5 installation when Nautobot installation already exists and migrated.
Observed Behavior
Installation failed during migrations:
Error Message:
psycopg2.errors.UndefinedColumn: column ipam_vlan.location_id does not exist
LINE 1: ...M "ipam_vlan" LEFT OUTER JOIN "dcim_location" ON ("ipam_vlan...
Steps to Reproduce
- Set up existing Nautobot 2.1.5 installation with out SSoT app installed
- Migrate Nautobot instance (without SSoT)
- Install SSoT application into Nautobot
- Attempt to migrate SSoT changes
I think this can be fixed by not importing the Models directly in https://github.com/nautobot/nautobot-app-ssot/blob/fd3299780bcdfd60b7408f9e842978c602ead04d/nautobot_ssot/migrations/0007_replace_dashed_custom_fields.py#L2-L5
EX:
for app, model [("dcim", "Device"), ("ipam", "VLAN")...]:
model = apps.get_model(app, model)
...
https://docs.djangoproject.com/en/5.0/topics/migrations/#historical-models