mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #3279: Reset the PostgreSQL sequence for Tag and TaggedItem IDs
This commit is contained in:
parent
bd9ef9951b
commit
5a6c928a7c
@ -3,6 +3,7 @@ v2.6.1 (FUTURE)
|
||||
## Bug Fixes
|
||||
|
||||
* [#3275](https://github.com/digitalocean/netbox/issues/3275) - Fix error when adding power outlets to a device type
|
||||
* [#3279](https://github.com/digitalocean/netbox/issues/3279) - Reset the PostgreSQL sequence for Tag and TaggedItem IDs
|
||||
|
||||
---
|
||||
|
||||
|
14
netbox/extras/migrations/0023_fix_tag_sequences.py
Normal file
14
netbox/extras/migrations/0023_fix_tag_sequences.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0022_custom_links'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# Update the last_value for tag Tag and TaggedItem ID sequences
|
||||
migrations.RunSQL("SELECT setval('extras_tag_id_seq', (SELECT id FROM extras_tag ORDER BY id DESC LIMIT 1) + 1)"),
|
||||
migrations.RunSQL("SELECT setval('extras_taggeditem_id_seq', (SELECT id FROM extras_taggeditem ORDER BY id DESC LIMIT 1) + 1)"),
|
||||
]
|
Loading…
Reference in New Issue
Block a user