Skip to content

Commit cfa4f2c

Browse files
fix proxmoxstorage migration in post4
1 parent 7fb0c64 commit cfa4f2c

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

netbox_proxbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ProxboxConfig(PluginConfig):
1717
name = "netbox_proxbox"
1818
verbose_name = "Proxbox"
1919
description = "Integrates Proxmox and Netbox"
20-
version = "0.0.9.post3"
20+
version = "0.0.9.post4"
2121
author = "Emerson Felipe (@emersonfelipesp)"
2222
author_email = "emersonfelipe.2003@gmail.com"
2323
min_version = "4.5.0"
Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1-
# Generated by Django 5.2.12 on 2026-03-31 22:57
2-
31
from django.db import migrations
42

53

64
class Migration(migrations.Migration):
7-
85
dependencies = [
9-
('netbox_proxbox', '0013_proxmoxstorage_cluster_foreignkey'),
10-
('virtualization', '0052_gfk_indexes'),
6+
("netbox_proxbox", "0013_proxmoxstorage_cluster_foreignkey"),
7+
("virtualization", "0052_gfk_indexes"),
118
]
129

1310
operations = [
1411
migrations.AlterModelOptions(
15-
name='proxmoxstorage',
16-
options={'ordering': ('cluster__name', 'name')},
12+
name="proxmoxstorage",
13+
options={"ordering": ("cluster__name", "name")},
1714
),
18-
migrations.AlterUniqueTogether(
19-
name='proxmoxstorage',
20-
unique_together={('cluster', 'name')},
15+
migrations.SeparateDatabaseAndState(
16+
database_operations=[
17+
migrations.RunSQL(
18+
sql="""
19+
ALTER TABLE netbox_proxbox_proxmoxstorage
20+
DROP CONSTRAINT IF EXISTS
21+
netbox_proxbox_proxmoxstorage_unique_cluster_name;
22+
CREATE UNIQUE INDEX IF NOT EXISTS
23+
netbox_proxbox_proxmoxstorage_cluster_id_name_uniq
24+
ON netbox_proxbox_proxmoxstorage (cluster_id, name);
25+
""",
26+
reverse_sql="""
27+
DROP INDEX IF EXISTS
28+
netbox_proxbox_proxmoxstorage_cluster_id_name_uniq;
29+
""",
30+
),
31+
],
32+
state_operations=[
33+
migrations.AlterUniqueTogether(
34+
name="proxmoxstorage",
35+
unique_together={("cluster", "name")},
36+
),
37+
],
2138
),
2239
]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "netbox-proxbox"
3-
version = "0.0.9.post3"
3+
version = "0.0.9.post4"
44
description = "Netbox Plugin - Integrate Proxmox and Netbox"
55
readme = "README.md"
66
authors = [

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)