Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server_tool_id_seq not incrementing when we insert a tool manually #6

Open
JasperWallace opened this issue Feb 15, 2016 · 1 comment

Comments

@JasperWallace
Copy link
Member

When we import the tools from the old acserver we insert the tool data into server_tool, including the id column, which we need to preserve.

As a result server_tool_id_seq does not get incremented (it starts at 1) and when trying to add a tool django dies with:

IntegrityError: duplicate key value violates unique constraint "server_tool_pkey"
DETAIL: Key (id)=(3) already exists.

in the logs.

I've manualy run:

select nextval('server_tool_id_seq'::regclass);

in postgres until server_tool_id_seq is outside the range of existing acnode id's so this issue is worked around for now, but we might encounter similar problems at some point.

@JasperWallace
Copy link
Member Author

JasperWallace commented Apr 21, 2016

see:

https://github.com/django/django/blob/master/django/core/management/commands/loaddata.py#L115

for how django does it.
We should remove the test tool with id 999 otherwise all subsequent tools will be > 999 which will look a bit wierd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant