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

Adding entities to DB sometimes requires committing twice #2296

Closed
PiispaH opened this issue Sep 1, 2023 · 2 comments
Closed

Adding entities to DB sometimes requires committing twice #2296

PiispaH opened this issue Sep 1, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@PiispaH
Copy link
Collaborator

PiispaH commented Sep 1, 2023

If a parameter value like in the picture below is added to the db and then committing is tried, the committing will result in an error like in the image. If then the error popup is closed and committing is tried again, the commit goes through smoothly. This doesn't seem to happen on parameter values of one dimensional entities.

image

@PiispaH PiispaH added bug Something isn't working 0.8-dev labels Sep 1, 2023
@PiispaH PiispaH added this to the v0.8.0 milestone Sep 1, 2023
@PiispaH PiispaH self-assigned this Sep 4, 2023
PiispaH added a commit to spine-tools/Spine-Database-API that referenced this issue Sep 6, 2023
The need for double committing arose from the fact that if an
entity or entity class was re-added after it had already been
deleted from the db, some of its data was still present in
the db. That caused some unique constraint errors.

- Previously when an entity was deleted, only the entity table
was considered. Now the data corresponding to the entity is
also deleted from the entity_element -table.

- When deleting an entity class, the data form the
entity_class_dimension -table corresponding to the classes id
is also deleted.

Re spine-tools/Spine-Toolbox#2296
@PiispaH
Copy link
Collaborator Author

PiispaH commented Sep 6, 2023

Should be fixed

@PiispaH PiispaH closed this as completed Sep 6, 2023
@manuelma
Copy link
Collaborator

manuelma commented Sep 6, 2023

Nice one @PiispaH !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants