dfo-mar-odis / dart

DFO At-sea Reporting Template, collect Elog, CTD and sample data at sea to produce reports then upload to BioChem at the end of the mission
3 stars 1 forks source link

Biochem load #169

Open upsonp opened 1 week ago

upsonp commented 1 week ago

I've had to rethink some of how Dart handles BioChem connections now that I have a better understanding of the process. Initially I included a 'biochem_table' field as part of the 'Mission' table to track what table data was being uploaded to, then I appended '_bcd_d', '_bcs_d', '_bcd_p', '_bcs_p' to whatever that table name was.

When looking at the mission filter page you see the 'Biochem Table' column indicating the base name for the mission after it was first uploaded and used the default "mission name" or a user defined table name: image

That's not going to work going forward.

What I want to propose is removing the 'biochem_table' column from the 'Mission' table. Then in the User preferences database, I want to add four columns to the 'BcDatabaseConnection' table (where I track databases a user connects to). I'd like to add a bc_discrete_station_edits, bc_discrete_data_edits , bc_plankton_station_edits, bc_plankton_data_edits columns. Then when a user setups a database connection they can use the defaults I'll provide (standard namings for BioChem data manager accounts) in the database form: image

These table names will be editable if the user wants to call them something else, but by default will use the Biochem table names for a biochem data manager account: BCDISCRETEDATAEDITS, BCDISCRETESTATNEDITS, BCPLANKTONDATAEDITS, BCPLANKTONSTATNEDITS

Unfortunately, this will break backwards compatibility with previous versions of Dart when it comes to BioChem loading as it currently works. Old mission databases will be migratable to the newer version with a button click, but newer missions won't be compatible with previous versions of Dart without using the Django Shell to preform a reverse migration.

Effectively moving us from Dart 3.x to Dart 4.0.0