diff --git a/LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql b/LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql index 282c962a..5c2de4e2 100644 --- a/LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql +++ b/LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql @@ -19,6 +19,7 @@ CREATE TABLE ldk.integers ( CONSTRAINT PK_integers PRIMARY KEY (value) ); +-- @SkipOnEmptySchemasBegin INSERT INTO ldk.integers (value) VALUES (0); INSERT INTO ldk.integers (value) VALUES (1); INSERT INTO ldk.integers (value) VALUES (2); @@ -120,4 +121,4 @@ INSERT INTO ldk.integers (value) VALUES (97); INSERT INTO ldk.integers (value) VALUES (98); INSERT INTO ldk.integers (value) VALUES (99); INSERT INTO ldk.integers (value) VALUES (100); - +-- @SkipOnEmptySchemasEnd diff --git a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.32-12.33.sql b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.32-12.33.sql index 8c5dda38..f1afb0d4 100644 --- a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.32-12.33.sql +++ b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.32-12.33.sql @@ -1,3 +1,4 @@ +-- @SkipOnEmptySchemasBegin INSERT INTO ldk.integers (value) VALUES (101); INSERT INTO ldk.integers (value) VALUES (102); INSERT INTO ldk.integers (value) VALUES (103); @@ -898,3 +899,4 @@ INSERT INTO ldk.integers (value) VALUES (997); INSERT INTO ldk.integers (value) VALUES (998); INSERT INTO ldk.integers (value) VALUES (999); INSERT INTO ldk.integers (value) VALUES (1000); +-- @SkipOnEmptySchemasEnd diff --git a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.35-12.36.sql b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.35-12.36.sql index 6ea54200..ff068c9c 100644 --- a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.35-12.36.sql +++ b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.35-12.36.sql @@ -5,10 +5,12 @@ CREATE TABLE ldk.daysOfWeek ( CONSTRAINT PK_daysOfWeek PRIMARY KEY (idx) ); +-- @SkipOnEmptySchemasBegin INSERT INTO ldk.daysOfWeek (idx, name) VALUES (1, 'Sunday'); INSERT INTO ldk.daysOfWeek (idx, name) VALUES (2, 'Monday'); INSERT INTO ldk.daysOfWeek (idx, name) VALUES (3, 'Tuesday'); INSERT INTO ldk.daysOfWeek (idx, name) VALUES (4, 'Wednesday'); INSERT INTO ldk.daysOfWeek (idx, name) VALUES (5, 'Thursday'); INSERT INTO ldk.daysOfWeek (idx, name) VALUES (6, 'Friday'); -INSERT INTO ldk.daysOfWeek (idx, name) VALUES (7, 'Saturday'); \ No newline at end of file +INSERT INTO ldk.daysOfWeek (idx, name) VALUES (7, 'Saturday'); +-- @SkipOnEmptySchemasEnd diff --git a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.36-12.37.sql b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.36-12.37.sql index 890babbe..b1527c9f 100644 --- a/LDK/resources/schemas/dbscripts/postgresql/ldk-12.36-12.37.sql +++ b/LDK/resources/schemas/dbscripts/postgresql/ldk-12.36-12.37.sql @@ -6,6 +6,7 @@ CREATE TABLE ldk.months ( CONSTRAINT PK_months PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin INSERT into ldk.months (monthName, monthNum) VALUES ('January', 1); INSERT into ldk.months (monthName, monthNum) VALUES ('February', 2); INSERT into ldk.months (monthName, monthNum) VALUES ('March', 3); @@ -18,3 +19,4 @@ INSERT into ldk.months (monthName, monthNum) VALUES ('September', 9); INSERT into ldk.months (monthName, monthNum) VALUES ('October', 10); INSERT into ldk.months (monthName, monthNum) VALUES ('November', 11); INSERT into ldk.months (monthName, monthNum) VALUES ('December', 12); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-0.00-11.10.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-0.00-11.10.sql index 0abc99fc..3a481674 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-0.00-11.10.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-0.00-11.10.sql @@ -216,11 +216,13 @@ WITH (OIDS=FALSE); -- ---------------------------- -- Records of laboratory.dna_mol_type -- ---------------------------- +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.dna_mol_type VALUES ('mRNA'); INSERT INTO laboratory.dna_mol_type VALUES ('vRNA'); INSERT INTO laboratory.dna_mol_type VALUES ('gDNA'); INSERT INTO laboratory.dna_mol_type VALUES ('Plasmid'); INSERT INTO laboratory.dna_mol_type VALUES ('RNA'); +-- @SkipOnEmptySchemasEnd -- ---------------------------- -- Table structure for laboratory.sample_type @@ -236,6 +238,7 @@ WITH (OIDS=FALSE); -- ---------------------------- -- Records of sample_type -- ---------------------------- +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.sample_type VALUES ('Nasal swab'); INSERT INTO laboratory.sample_type VALUES ('PBMC'); INSERT INTO laboratory.sample_type VALUES ('Plasma'); @@ -245,6 +248,7 @@ INSERT INTO laboratory.sample_type VALUES ('Total RNA'); INSERT INTO laboratory.sample_type VALUES ('mRNA'); INSERT INTO laboratory.sample_type VALUES ('vRNA'); INSERT INTO laboratory.sample_type VALUES ('RNA'); +-- @SkipOnEmptySchemasEnd -- ---------------------------- -- Table structure for laboratory.sample_additive @@ -256,10 +260,12 @@ CREATE TABLE laboratory.sample_additive CONSTRAINT PK_sample_additive PRIMARY KEY (additive) ) WITH (OIDS=FALSE); +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.sample_additive (Additive) VALUES ('EDTA'), ('Heparin'), ('RNA Later'), ('Sodium citrate'); -INSERT INTO laboratory.sample_type VALUES ('Cell Line'); \ No newline at end of file +INSERT INTO laboratory.sample_type VALUES ('Cell Line'); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.10-11.20.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.10-11.20.sql index 956cd1ed..261b4e73 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.10-11.20.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.10-11.20.sql @@ -26,11 +26,13 @@ ALTER TABLE laboratory.inventory /* laboratory-11.13-11.14.sql */ +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.sample_type VALUES ('BLCL'), ('DNA'), ('Whole Blood') ; +-- @SkipOnEmptySchemasEnd ALTER TABLE laboratory.inventory add column cell_number float @@ -124,6 +126,7 @@ CREATE TABLE laboratory.report_types CONSTRAINT pk_report_types PRIMARY KEY (type ) ); +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.report_types (type) VALUES ('query'), @@ -132,7 +135,7 @@ INSERT INTO laboratory.report_types ('webpart'), ('details') ; - +-- @SkipOnEmptySchemasEnd -- ---------------------------- -- Table structure for laboratory.subjects @@ -181,6 +184,7 @@ WITH (OIDS=FALSE) -- ---------------------------- -- Records of laboratory.species -- ---------------------------- +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.species (common_name, scientific_name, mhc_prefix) VALUES @@ -197,7 +201,7 @@ VALUES ('Mouse', 'Mus musculus', null), ('Rat', 'Rattus norvegicus', null) ; - +-- @SkipOnEmptySchemasEnd DROP TABLE IF EXISTS laboratory.geographic_origins; CREATE TABLE laboratory.geographic_origins ( @@ -226,6 +230,7 @@ CREATE TABLE laboratory.well_layout ( CONSTRAINT PK_well_layout PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.well_layout (Plate,Well_96,Well_96_Padded,Well_384,Well_384_Padded,AddressByRow_96,AddressByColumn_96,AddressByColumn_384,AddressByRow_384) VALUES @@ -614,7 +619,7 @@ VALUES (4, 'H11', 'H11', 'P23', 'P23', 95, 88, 368, 383), (4, 'H12', 'H12', 'P24', 'P24', 96, 96, 384, 384) ; - +-- @SkipOnEmptySchemasEnd -- ---------------------------- -- Table structure for laboratory.genders @@ -631,6 +636,7 @@ WITH (OIDS=FALSE) ; +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.genders (code, meaning, numericvalue) VALUES @@ -638,10 +644,14 @@ VALUES ('f', 'Female', 2), ('u', 'Unknown', 0) ; +-- @SkipOnEmptySchemasEnd drop table if exists laboratory.samples; +-- @SkipOnEmptySchemasBegin insert into laboratory.sample_type (type) values ('gDNA'); +-- @SkipOnEmptySchemasEnd + insert into laboratory.sample_source (source) values ('gDNA'); insert into laboratory.sample_source (source) values ('DNA'); diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.20-11.30.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.20-11.30.sql index 1ae44c60..84ff94a3 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.20-11.30.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-11.20-11.30.sql @@ -21,7 +21,7 @@ alter table laboratory.samples add column subjectid varchar(200) ; - +-- @SkipOnEmptySchemasBegin insert into laboratory.species (common_name,scientific_name) values @@ -35,6 +35,7 @@ values insert into laboratory.dna_mol_type (mol_type) values ('Vector') ; +-- @SkipOnEmptySchemasEnd DROP TABLE IF EXISTS laboratory.site_module_properties; CREATE TABLE laboratory.site_module_properties ( diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.20-12.21.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.20-12.21.sql index cdbdb2e5..d2dc91b7 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.20-12.21.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.20-12.21.sql @@ -34,10 +34,12 @@ CREATE TABLE laboratory.qual_results CONSTRAINT PK_qual_results PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.qual_results (meaning, description) VALUES ('POS', 'Positive'); INSERT INTO laboratory.qual_results (meaning, description) VALUES ('NEG', 'Negative'); INSERT INTO laboratory.qual_results (meaning, description) VALUES ('OUTLIER', 'Outlier'); INSERT INTO laboratory.qual_results (meaning, description) VALUES ('ND', 'No Data'); +-- @SkipOnEmptySchemasEnd CREATE TABLE laboratory.assay_requests ( diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.22-12.23.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.22-12.23.sql index a3aa196d..cd59ead2 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.22-12.23.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.22-12.23.sql @@ -14,6 +14,7 @@ * limitations under the License. */ delete from laboratory.reference_peptides; +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('AAAQQRGPRK', null); INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('AADWDLQHPQ', null); INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('AADWDLQHPQPAPQQGQLRE', null); @@ -5017,3 +5018,4 @@ INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('Y INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('YYREGRDQLWKGPGE', null); INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('YYSARRHRIL', null); INSERT INTO laboratory.reference_peptides (sequence, mhc_restriction) VALUES ('YYSARRHRILDIYLE', null); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.24-12.25.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.24-12.25.sql index 5b014fb0..2108861c 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.24-12.25.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.24-12.25.sql @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +-- @SkipOnEmptySchemasBegin DELETE FROM laboratory.sample_type WHERE type = 'Serum'; INSERT INTO laboratory.sample_type (type) VALUES ('Serum'); DELETE FROM laboratory.sample_type WHERE type = 'Tissue'; INSERT INTO laboratory.sample_type (type) VALUES ('Tissue'); DELETE FROM laboratory.sample_type WHERE type = 'Supernatant'; INSERT INTO laboratory.sample_type (type) VALUES ('Supernatant'); +-- @SkipOnEmptySchemasEnd -- NOTE: SQLServer will not allow 2 FKs pointing to the same table with update cascade -- therefore rather than let 1 field update and the other not, we get rid of both diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.25-12.26.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.25-12.26.sql index 9bf6b09f..4405d8ac 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.25-12.26.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.25-12.26.sql @@ -17,4 +17,7 @@ DROP TABLE laboratory.site_module_properties; DROP TABLE laboratory.module_properties; INSERT INTO laboratory.samplecategory (category) VALUES ('NTC'); -INSERT INTO laboratory.samplecategory (category) VALUES ('Unknown'); \ No newline at end of file + +-- @SkipOnEmptySchemasBegin +INSERT INTO laboratory.samplecategory (category) VALUES ('Unknown'); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.273-12.274.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.273-12.274.sql index 25f880dc..5b5247bc 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.273-12.274.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.273-12.274.sql @@ -9,11 +9,13 @@ DELETE FROM laboratory.samplecategory WHERE category = 'Pos Control'; DELETE FROM laboratory.samplecategory WHERE category = 'Neg Control'; DELETE FROM laboratory.samplecategory WHERE category = 'Control'; +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.samplecategory (category) VALUES ('Pos Control'); INSERT INTO laboratory.samplecategory (category) VALUES ('Neg Control'); INSERT INTO laboratory.samplecategory (category) VALUES ('Control'); INSERT INTO laboratory.samplecategory (category) VALUES ('Blank'); INSERT INTO laboratory.samplecategory (category) VALUES ('Standard'); +-- @SkipOnEmptySchemasEnd ALTER TABLE laboratory.samplecategory ADD control boolean; UPDATE laboratory.samplecategory SET control = true; diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.279-12.280.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.279-12.280.sql index 5061a66d..6e657fcc 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.279-12.280.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.279-12.280.sql @@ -18,6 +18,7 @@ CREATE TABLE laboratory.workbook_group_members ( CONSTRAINT pk_workbook_group_members PRIMARY KEY (rowid) ); +-- @SkipOnEmptySchemasBegin DELETE FROM laboratory.sample_type WHERE type = 'Brain'; INSERT INTO laboratory.sample_type (type) VALUES ('Brain'); @@ -29,6 +30,7 @@ INSERT INTO laboratory.sample_type (type) VALUES ('Spleen'); DELETE FROM laboratory.sample_additive WHERE additive = 'Filter Paper'; INSERT INTO laboratory.sample_additive (additive) VALUES ('Filter Paper'); +-- @SkipOnEmptySchemasEnd ALTER TABLE laboratory.workbooks ADD folder entityid; diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.286-12.287.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.286-12.287.sql index 9af1d369..da071f85 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.286-12.287.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.286-12.287.sql @@ -5,6 +5,8 @@ CREATE TABLE laboratory.result_status ( CONSTRAINT PK_result_status PRIMARY KEY (status) ); +-- @SkipOnEmptySchemasBegin INSERT INTO laboratory.result_status (status, not_trusted) VALUES ('Definitive', false); INSERT INTO laboratory.result_status (status, not_trusted) VALUES ('Outlier', true); -INSERT INTO laboratory.result_status (status, not_trusted) VALUES ('Replaced', true); \ No newline at end of file +INSERT INTO laboratory.result_status (status, not_trusted) VALUES ('Replaced', true); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.296-12.297.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.296-12.297.sql index dddfc5b7..c2b835e2 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.296-12.297.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.296-12.297.sql @@ -1 +1,3 @@ -INSERT INTO laboratory.result_status (status) VALUES ('Exclude'); \ No newline at end of file +-- @SkipOnEmptySchemasBegin +INSERT INTO laboratory.result_status (status) VALUES ('Exclude'); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.297-12.298.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.297-12.298.sql index 5c473584..82960b2f 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.297-12.298.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.297-12.298.sql @@ -1,2 +1,4 @@ +-- @SkipOnEmptySchemasBegin DELETE FROM laboratory.result_status WHERE status = 'No Data'; -INSERT INTO laboratory.result_status (status) VALUES ('No Data'); \ No newline at end of file +INSERT INTO laboratory.result_status (status) VALUES ('No Data'); +-- @SkipOnEmptySchemasEnd diff --git a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.299-12.300.sql b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.299-12.300.sql index fd0f4fea..06703c28 100644 --- a/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.299-12.300.sql +++ b/laboratory/resources/schemas/dbscripts/postgresql/laboratory-12.299-12.300.sql @@ -1,2 +1,4 @@ +-- @SkipOnEmptySchemasBegin DELETE FROM laboratory.species WHERE common_name = 'Rabbit'; -INSERT INTO laboratory.species (common_name, scientific_name) VALUES ('Rabbit', 'Lepus curpaeums'); \ No newline at end of file +INSERT INTO laboratory.species (common_name, scientific_name) VALUES ('Rabbit', 'Lepus curpaeums'); +-- @SkipOnEmptySchemasEnd