JeffreyGaydos / music-database-generator

An idea to help organize your music with extra metadata using a SQL Server Database. This repository searches through a folder and gathers metadata already in mp3 files to add to a database
2 stars 1 forks source link

Add Constraints to Enforce Uniqueness of Data (And Prevent Unexpected Behavior) #12

Closed JeffreyGaydos closed 1 year ago

JeffreyGaydos commented 1 year ago

Add constraints on tables that have data that should theoretically be unique. If this data is not unique, the user either supplied duplicate data or the data supplied was very similar.

The unique constraints (added to "primary" tables) should be designed so as to not be restrictive on the kinds of data able to be input, but the size limit of keys in SQL server is restrictive in its own way.

Additionally, foreign keys should be added to "secondary" tables that map between "primary" tables so that the values in these tables can reliably be used to map to "primary" tables.