mardi 26 octobre 2021

How to optimise database design for software versions

We want to design database schema which will have information related to software release and it's mapping -- to which software version it can be updated and downgraded to.

Current database schema -

software_version
------------------------------------------------
ID 
version - string
release_notes - string
artifacts_url - string

We have another table where we keeps mapping for those -

software_version_mapping
------------------------------------------------
ID 
base_version - foreign key to software_version
update_to_version - foreign key to software_version

This way works for both update and downgrade. But the problem is we have more than 100 version and software_version_mapping is growing too much since we have to keep mapping with all for new version.

Can I get suggestion on this - how can we minimise the entries in software_version_mapping which will satisfy conditions like -

  1. new version can be updated from any / all previous one
  2. new version can be updated from only selected old versions
  3. new version can be updated between range of versions
  4. we should be able to add downgrade mapping as well

Thanks in Advance!

Aucun commentaire:

Enregistrer un commentaire