Skip to content

Commit

Permalink
BHBC-1342_V3 (#530)
Browse files Browse the repository at this point in the history
* BHBC-1343_V3
  - adjustments to survey summary results persistence targets
  - addition of survey_summary_submission and survey_summary_submission_message tables
  - removed survey_summary_general and summary_parameter_method_code tables
  - adjustments to satisfy BHBC-1375 for project report attachment workflow
  - addition of table project_report_attachment and author tables
  - various seed population and data integrity checks
  • Loading branch information
cgarrettjones authored Sep 21, 2021
1 parent 35a5e45 commit 8916dd4
Show file tree
Hide file tree
Showing 54 changed files with 358 additions and 203 deletions.
6 changes: 1 addition & 5 deletions database/src/migrations/20210225205948_biohub_release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
const DB_USER_API_PASS = process.env.DB_USER_API_PASS;
const DB_USER_API = process.env.DB_USER_API;

const DB_RELEASE = 'release.0.26';
const DB_RELEASE = 'release.0.28';

/**
* Apply biohub release changes.
Expand Down Expand Up @@ -95,9 +95,6 @@ export async function up(knex: Knex): Promise<void> {
path.join(__dirname, DB_RELEASE, 'populate_common_survey_methodology.sql')
);
const populate_template = fs.readFileSync(path.join(__dirname, DB_RELEASE, 'populate_template.sql'));
const populate_summary_parameter_method_code = fs.readFileSync(
path.join(__dirname, DB_RELEASE, 'populate_summary_parameter_method_code.sql')
);
const populate_summary_parameter_code = fs.readFileSync(
path.join(__dirname, DB_RELEASE, 'populate_summary_parameter_code.sql')
);
Expand Down Expand Up @@ -188,7 +185,6 @@ export async function up(knex: Knex): Promise<void> {
${populate_system_metadata_constant}
${populate_common_survey_methodology}
${populate_template}
${populate_summary_parameter_method_code}
${populate_summary_parameter_code}
-- temporary external interface tables
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ declare
delete from project_funding_source where project_id = p_project_id;
delete from project_iucn_action_classification where project_id = p_project_id;
delete from project_attachment where project_id = p_project_id;
delete from author where project_report_attachment_id in (select project_report_attachment_id from project_report_attachment where project_id = p_project_id);
delete from project_report_attachment where project_id = p_project_id;
delete from project_first_nation where project_id = p_project_id;
delete from project_participation where project_id = p_project_id;
delete from project where project_id = p_project_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ $$
-- 2021-06-18 initial release
-- [email protected]
-- 2021-06-21 added occurrence submission delete
-- [email protected]
-- 2021-09-21 added survey summary submission delete
-- *******************************************************************
declare
_occurrence_submission_id occurrence_submission.occurrence_submission_id%type;
Expand All @@ -25,8 +27,8 @@ begin
call api_delete_occurrence_submission(_occurrence_submission_id);
end loop;

delete from survey_summary_detail where survey_summary_general_id in (select survey_summary_general_id from survey_summary_general where survey_id = p_survey_id);
delete from survey_summary_general where survey_id = p_survey_id;
delete from survey_summary_detail where survey_summary_submission_id in (select survey_summary_submission_id from survey_summary_submission where survey_id = p_survey_id);
delete from survey_summary_submission where survey_id = p_survey_id;
delete from survey_proprietor where survey_id = p_survey_id;
delete from survey_attachment where survey_id = p_survey_id;
delete from study_species where survey_id = p_survey_id;
Expand Down
Loading

0 comments on commit 8916dd4

Please sign in to comment.