From 26da35d05615dd283eaff8bb758e2436a513922f Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 1 Aug 2025 12:46:42 -0700 Subject: [PATCH] Skip inserting data when creating empty schemas --- .../postgresql/genotypeassays-0.00-0.01.sql | 4 +++- .../postgresql/genotypeassays-0.02-0.03.sql | 4 +++- .../postgresql/elispot_assay-0.00-0.01.sql | 2 ++ .../postgresql/elispot_assay-0.02-0.03.sql | 4 +++- .../postgresql/elispot_assay-0.03-0.04.sql | 2 ++ .../postgresql/flowassays-0.00-0.01.sql | 16 +++++++++++----- .../postgresql/flowassays-0.02-0.03.sql | 4 +++- .../postgresql/flowassays-12.21-12.22.sql | 4 +++- .../dbscripts/postgresql/tcrdb-15.31-15.32.sql | 2 ++ 9 files changed, 32 insertions(+), 10 deletions(-) diff --git a/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.00-0.01.sql b/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.00-0.01.sql index 5935ea077..8e4b096a9 100644 --- a/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.00-0.01.sql +++ b/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.00-0.01.sql @@ -23,6 +23,8 @@ CREATE TABLE genotypeassays.assaytypes ( CONSTRAINT pk_assaytypes PRIMARY KEY (name) ); +-- @SkipOnEmptySchemasBegin INSERT INTO genotypeassays.assaytypes (name, description) VALUES ('SSP', 'Sequence-specific PCR'); INSERT INTO genotypeassays.assaytypes (name, description) VALUES ('STR', 'Microsatellite'); -INSERT INTO genotypeassays.assaytypes (name, description) VALUES ('SBT', 'Sequence-based Genotyping'); \ No newline at end of file +INSERT INTO genotypeassays.assaytypes (name, description) VALUES ('SBT', 'Sequence-based Genotyping'); +-- @SkipOnEmptySchemasEnd diff --git a/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.02-0.03.sql b/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.02-0.03.sql index 2bf5f41fa..824f17641 100644 --- a/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.02-0.03.sql +++ b/GenotypeAssays/resources/schemas/dbscripts/postgresql/genotypeassays-0.02-0.03.sql @@ -26,7 +26,9 @@ CREATE TABLE genotypeassays.ssp_result_types CONSTRAINT PK_ssp_result_types PRIMARY KEY (result) ); +-- @SkipOnEmptySchemasBegin INSERT into genotypeassays.ssp_result_types (result, meaning, importAliases) VALUES ('POS', 'Positive', '+,1,Y'); INSERT into genotypeassays.ssp_result_types (result, meaning, importAliases) VALUES ('NEG', 'Negative', '-,0,N'); INSERT into genotypeassays.ssp_result_types (result, meaning, importAliases) VALUES ('IND', 'Indeterminate', null); -INSERT into genotypeassays.ssp_result_types (result, meaning, importAliases) VALUES ('FAIL', 'Fail', 'F'); \ No newline at end of file +INSERT into genotypeassays.ssp_result_types (result, meaning, importAliases) VALUES ('FAIL', 'Fail', 'F'); +-- @SkipOnEmptySchemasEnd diff --git a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.00-0.01.sql b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.00-0.01.sql index 3775f490e..bbca44554 100644 --- a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.00-0.01.sql +++ b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.00-0.01.sql @@ -56,7 +56,9 @@ CREATE TABLE elispot_assay.assay_types ( constraint PK_assay_types PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin INSERT INTO elispot_assay.assay_types (name, description) VALUES ('IFN-Gamma', 'Interferon Gamma'); +-- @SkipOnEmptySchemasEnd CREATE TABLE elispot_assay.instruments ( diff --git a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.02-0.03.sql b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.02-0.03.sql index 903bed2a8..dc16f2ec5 100644 --- a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.02-0.03.sql +++ b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.02-0.03.sql @@ -1 +1,3 @@ -INSERT INTO elispot_assay.instruments (instrument) VALUES ('AID Plate Reader'); \ No newline at end of file +-- @SkipOnEmptySchemasBegin +INSERT INTO elispot_assay.instruments (instrument) VALUES ('AID Plate Reader'); +-- @SkipOnEmptySchemasEnd diff --git a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.03-0.04.sql b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.03-0.04.sql index efb8a7f8e..b551f5fab 100644 --- a/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.03-0.04.sql +++ b/elispot_assay/resources/schemas/dbscripts/postgresql/elispot_assay-0.03-0.04.sql @@ -1,3 +1,4 @@ +-- @SkipOnEmptySchemasBegin TRUNCATE TABLE elispot_assay.peptide_pools; INSERT INTO elispot_assay.peptide_pools (pool_name, category) VALUES ('SIVmac239 Env Pool A', 'SIV'); INSERT INTO elispot_assay.peptide_pools (pool_name, category) VALUES ('SIVmac239 Env Pool B', 'SIV'); @@ -909,3 +910,4 @@ INSERT INTO elispot_assay.peptide_pool_members (poolid, sequence) select rowid, INSERT INTO elispot_assay.peptide_pool_members (poolid, sequence) select rowid, 'GKEVDSSSHMEDTGE' as sequence from elispot_assay.peptide_pools pp WHERE pp.pool_name = 'SIVmac239 Pol Pool Z'; INSERT INTO elispot_assay.peptide_pool_members (poolid, sequence) select rowid, 'DSSSHMEDTGEAREV' as sequence from elispot_assay.peptide_pools pp WHERE pp.pool_name = 'SIVmac239 Pol Pool Z'; INSERT INTO elispot_assay.peptide_pool_members (poolid, sequence) select rowid, 'HMEDTGEAREVA' as sequence from elispot_assay.peptide_pools pp WHERE pp.pool_name = 'SIVmac239 Pol Pool Z'; +-- @SkipOnEmptySchemasEnd diff --git a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.00-0.01.sql b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.00-0.01.sql index 845989fae..f10f091c6 100644 --- a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.00-0.01.sql +++ b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.00-0.01.sql @@ -30,6 +30,7 @@ CREATE TABLE flowassays.populations CONSTRAINT PK_populations PRIMARY KEY (Name) ); +-- @SkipOnEmptySchemasBegin INSERT INTO flowassays.populations (Name) VALUES ('NK'), ('CD14 Mono'), @@ -38,7 +39,7 @@ INSERT INTO flowassays.populations (Name) VALUES ('CD4'), ('CD14'), ('CD8'); - +-- @SkipOnEmptySchemasEnd CREATE TABLE flowassays.units ( @@ -47,15 +48,16 @@ CREATE TABLE flowassays.units CONSTRAINT PK_units PRIMARY KEY (unit) ); +-- @SkipOnEmptySchemasBegin INSERT INTO flowassays.units VALUES ('cells/uL'), ('Tc/uL'); - +-- @SkipOnEmptySchemasEnd UPDATE flowassays.populations SET Name = 'CD4 T-cells' WHERE Name = 'CD4'; UPDATE flowassays.populations SET Name = 'CD8 T-cells' WHERE Name = 'CD8'; - +-- @SkipOnEmptySchemasBegin INSERT INTO flowassays.units VALUES ('%'); - +-- @SkipOnEmptySchemasEnd CREATE TABLE flowassays.instruments ( @@ -64,7 +66,9 @@ CREATE TABLE flowassays.instruments CONSTRAINT PK_instruments PRIMARY KEY (instrument) ); +-- @SkipOnEmptySchemasBegin INSERT INTO flowassays.instruments VALUES ('BD LSR II'); +-- @SkipOnEmptySchemasEnd CREATE TABLE flowassays.assay_types ( rowid serial, @@ -74,6 +78,7 @@ CREATE TABLE flowassays.assay_types ( constraint pk_assay_types PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin DELETE FROM flowassays.populations WHERE name = 'NK'; DELETE FROM flowassays.populations WHERE name = 'CD4'; DELETE FROM flowassays.populations WHERE name = 'CD8'; @@ -97,4 +102,5 @@ DELETE FROM flowassays.populations WHERE name = 'T-cells'; INSERT INTO flowassays.populations(name) VALUES ('T-cells'); -INSERT INTO flowassays.assay_types(name) VALUES ('TruCount'); \ No newline at end of file +INSERT INTO flowassays.assay_types(name) VALUES ('TruCount'); +-- @SkipOnEmptySchemasEnd diff --git a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.02-0.03.sql b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.02-0.03.sql index 7265b1ea4..852e6a0ec 100644 --- a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.02-0.03.sql +++ b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-0.02-0.03.sql @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +-- @SkipOnEmptySchemasBegin DELETE FROM flowassays.populations WHERE name = 'T-cells'; DELETE FROM flowassays.populations WHERE name = 'T-Cells'; INSERT INTO flowassays.populations (name) VALUES ('T-cells'); @@ -20,4 +21,5 @@ INSERT INTO flowassays.populations (name) VALUES ('T-cells'); DELETE FROM flowassays.populations WHERE name = 'Lymphocytes'; INSERT INTO flowassays.populations (name) VALUES ('Lymphocytes'); -INSERT INTO flowassays.assay_types (name) VALUES ('Phenotyping'); \ No newline at end of file +INSERT INTO flowassays.assay_types (name) VALUES ('Phenotyping'); +-- @SkipOnEmptySchemasEnd diff --git a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-12.21-12.22.sql b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-12.21-12.22.sql index c2d82053c..75842099c 100644 --- a/flowassays/resources/schemas/dbscripts/postgresql/flowassays-12.21-12.22.sql +++ b/flowassays/resources/schemas/dbscripts/postgresql/flowassays-12.21-12.22.sql @@ -1,7 +1,9 @@ -DELETE FROM flowassays.populations WHERE name = 'Lymphocytes'; +-- @SkipOnEmptySchemasBegin +DELETE FROM flowassays.populations WHERE name = 'Lymphocytes'; INSERT INTO flowassays.populations (name) VALUES ('Lymphocytes'); DELETE FROM flowassays.assay_types WHERE name = 'Tetramer'; DELETE FROM flowassays.assay_types WHERE name = 'Phenotyping'; INSERT INTO flowassays.assay_types(name) VALUES ('Tetramer'); INSERT INTO flowassays.assay_types(name) VALUES ('Phenotyping'); +-- @SkipOnEmptySchemasEnd diff --git a/tcrdb/resources/schemas/dbscripts/postgresql/tcrdb-15.31-15.32.sql b/tcrdb/resources/schemas/dbscripts/postgresql/tcrdb-15.31-15.32.sql index dce7d9314..53db64cf4 100644 --- a/tcrdb/resources/schemas/dbscripts/postgresql/tcrdb-15.31-15.32.sql +++ b/tcrdb/resources/schemas/dbscripts/postgresql/tcrdb-15.31-15.32.sql @@ -4,6 +4,7 @@ CREATE TABLE tcrdb.loci ( constraint PK_loci PRIMARY KEY (locus) ); +-- @SkipOnEmptySchemasBegin INSERT INTO tcrdb.loci (locus) VALUES ('IGH'); INSERT INTO tcrdb.loci (locus) VALUES ('IGL'); INSERT INTO tcrdb.loci (locus) VALUES ('IGK'); @@ -14,3 +15,4 @@ INSERT INTO tcrdb.loci (locus) VALUES ('TRD'); INSERT INTO tcrdb.loci (locus) VALUES ('IG'); INSERT INTO tcrdb.loci (locus) VALUES ('TCR'); INSERT INTO tcrdb.loci (locus) VALUES ('ALL'); +-- @SkipOnEmptySchemasEnd