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

add fixture duplication script #140

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

add fixture duplication script #140

wants to merge 2 commits into from

Conversation

stevekm
Copy link
Member

@stevekm stevekm commented Feb 15, 2020

Created a script to help in producing new unique db fixtures based on old pre-existing ones.

Hopefully this will help with #139

@stevekm
Copy link
Member Author

stevekm commented Feb 16, 2020

A note about this script: it is not possible to change the primary key on File entries, because there is a unique constraint in the File model on File.path.

This results in the problem described in #122. When loading a an old saved Run fixture set along with its new duplicated Run fixture set created with this script, the two Run's will have the exact same File entries due to the unique constraints in the database. Then, when trying to resolve the FileMetadata associated with each Port item in both the old and new fixture sets, only one FileMetadata will be returned because the current method for looking up FileMetadata for a given File requires returning only the Filemetadata with the highest version/most recent date.

Thus, despite having two unique Run's and sets of Port's and FileMetadata's, it is not possible to actually retrieve the FileMetadata for the newly created Port items due to the lack of direct association between Port and FileMetadata.

A potential solution could be to change the value for File.path, allowing for a new File primary key to be made and propagated, but currently it is not clear what value File.path could be changed to since Beagle assumes that all File.path items exist as real file paths on the filesystem. Need input on this.

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

Successfully merging this pull request may close these issues.

1 participant