KaylaCrush / advocacy-maps

The good governance project (GGP) is a non-partisan democracy reform group.
https://mapletestimony.org
MIT License
0 stars 1 forks source link

duplication detection for psql #38

Closed KaylaCrush closed 1 year ago

KaylaCrush commented 1 year ago

Right now it's possible to upload the same table to postgres multiple times, and it will just let you do it. I need to add primary keys. see #36

KaylaCrush commented 1 year ago

this should be done as part of #53. Before saving a header, I need to search the table to see if that combination of source_name and date_range has appeared before. if it HAS, stop the presses, this data has already been uploaded! No need to save anything else

KaylaCrush commented 1 year ago

did this using a composite primary key. If you try and save a header with the same date range and source name as one that already exists, we get errored out and nothing else saves.