MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
148 stars 48 forks source link

Make molecules not unique by hash again #668

Closed bennybp closed 3 years ago

bennybp commented 3 years ago

Description

It turns out that due to some other issues, the molecule table can have duplicate molecules. This is confirmed in the main MolSSI database, which has >400 duplicates. This of course breaks the migration in v0.15.4

This is a serious issue, which also leads to other consistency issues. But that is something for another day

So for now what we can do is this:

1.) Comment out that part of the previous migration (c05d) 2.) Add a migration that deletes the old index, and adds a new one with unique=False (6b07)

Assume this commit forms release v0.15.5. These modifications should work in the following two scenarios

1.) User upgraded (successfully) to v0.15.4 prior to this commit/release. Their migration for c05d made the molecule hash unique. The new migration 6b07 will delete that unique index and make a new one with unique=False

2.) User did not upgrade to v0.15.4. The updated old migration c05d will not touch the molecule table. The new migration 6b07 will delete the existing (non-unique) index, and just recreate it.

Changelog description

Status

codecov[bot] commented 3 years ago

Codecov Report

Merging #668 (31e69cb) into master (509eed1) will not change coverage. The diff coverage is 100.00%.

bennybp commented 3 years ago

This still isn't completely functional. There are duplicate base_result.hash_index as well. I have to remove that migration the same as I did for molecule :(

bennybp commented 3 years ago

After these changes, it will now successfully migrate the molssi database