utah-geological-survey / gwp_cloud_db

Guidelines and issues for uploading and managing data uploads to the GWP cloud database
GNU General Public License v3.0
0 stars 0 forks source link

barometer table data constraint updates #19

Open wetlandsDiane opened 4 days ago

wetlandsDiane commented 4 days ago

Here are some steps for cleaning up the barometers table. I have attached a script that should do everything besides fixing the auto-increment. I sent the script to Nate - I can't run as a non-owner of the table

  1. readingdate- make not null; currently no null values
  2. measuredlevel- make not null; currently no null values
  3. locationid- make not null, currently no null values; ensure match in locations table
  4. Already an index on readingdating and locationid; change to a unique index; two records need to be deleted first (see locationid=9069 and readingdate ='2021-11-04 12:00:00.000')
  5. objectid change to an identity column or serial column- make it auto-generate, currently int4 with no default

barometer_structure_updates.txt