Skip to content

Commit e7cefb0

Browse files
committed
Merge branch 'fix-qiita-db-tests' into fix-analysis-tests
2 parents b43c3cc + 3d4d7dd commit e7cefb0

File tree

2 files changed

+10
-11
lines changed
  • qiita_db/support_files/patches

2 files changed

+10
-11
lines changed

qiita_db/support_files/patches/23.sql

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ LOOP
4949

5050
-- Copy the values from the required_sample_info table to the dynamic table
5151
EXECUTE '
52-
WITH sample_values AS (SELECT *
53-
FROM qiita.required_sample_info
54-
JOIN qiita.required_sample_info_status
55-
USING (required_sample_info_status_id)
56-
WHERE study_id = ' || st_id || ')
52+
WITH sv AS (SELECT * FROM qiita.required_sample_info
53+
JOIN qiita.required_sample_info_status
54+
USING (required_sample_info_status_id)
55+
WHERE study_id = ' || st_id || ')
5756
UPDATE ' || dyn_table || '
5857
SET physical_specimen_location=sv.physical_location,
5958
physical_specimen_remaining=sv.has_physical_specimen,
@@ -65,7 +64,7 @@ LOOP
6564
latitude=sv.latitude,
6665
longitude=sv.longitude,
6766
required_sample_info_status=sv.status
68-
FROM sample_values sv
67+
FROM sv
6968
WHERE ' || dyn_table || '.sample_id = sv.sample_id;';
7069

7170
END LOOP;
@@ -125,15 +124,14 @@ LOOP
125124

126125
-- Copy the values from the common_prep_info table to the dynamic table
127126
EXECUTE '
128-
WITH sample_values AS (SELECT *
129-
FROM qiita.common_prep_info
130-
JOIN qiita.emp_status USING (emp_status_id)
131-
WHERE prep_template_id = ' || prep_id || ')
127+
WITH sv AS (SELECT * FROM qiita.common_prep_info
128+
JOIN qiita.emp_status USING (emp_status_id)
129+
WHERE prep_template_id = ' || prep_id || ')
132130
UPDATE ' || dyn_table || '
133131
SET center_name=sv.center_name,
134132
center_project_name=sv.center_project_name,
135133
emp_status=sv.emp_status
136-
FROM sample_values sv
134+
FROM sv
137135
WHERE ' || dyn_table || '.sample_id=sv.sample_id;';
138136

139137
END LOOP;

qiita_db/support_files/patches/python_patches/23.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Need to re-generate the files, given that some headers have changed
33

44
from qiita_db.sql_connection import SQLConnectionHandler
5+
from qiita_db.metadata_template import SampleTemplate, PrepTemplate
56

67
conn_handler = SQLConnectionHandler()
78

0 commit comments

Comments
 (0)