Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion LDK/resources/schemas/dbscripts/postgresql/ldk-0.01-0.02.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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');
INSERT INTO ldk.daysOfWeek (idx, name) VALUES (7, 'Saturday');
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand All @@ -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
Expand All @@ -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');
INSERT INTO laboratory.sample_type VALUES ('Cell Line');
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),
Expand All @@ -132,7 +135,7 @@ INSERT INTO laboratory.report_types
('webpart'),
('details')
;

-- @SkipOnEmptySchemasEnd

-- ----------------------------
-- Table structure for laboratory.subjects
Expand Down Expand Up @@ -181,6 +184,7 @@ WITH (OIDS=FALSE)
-- ----------------------------
-- Records of laboratory.species
-- ----------------------------
-- @SkipOnEmptySchemasBegin
INSERT INTO laboratory.species
(common_name, scientific_name, mhc_prefix)
VALUES
Expand All @@ -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 (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -631,17 +636,22 @@ WITH (OIDS=FALSE)

;

-- @SkipOnEmptySchemasBegin
INSERT INTO laboratory.genders
(code, meaning, numericvalue)
VALUES
('m', 'Male', 1),
('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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ alter table laboratory.samples
add column subjectid varchar(200)
;


-- @SkipOnEmptySchemasBegin
insert into laboratory.species
(common_name,scientific_name)
values
Expand All @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

-- @SkipOnEmptySchemasBegin
INSERT INTO laboratory.samplecategory (category) VALUES ('Unknown');
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
INSERT INTO laboratory.result_status (status, not_trusted) VALUES ('Replaced', true);
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
INSERT INTO laboratory.result_status (status) VALUES ('Exclude');
-- @SkipOnEmptySchemasBegin
INSERT INTO laboratory.result_status (status) VALUES ('Exclude');
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
-- @SkipOnEmptySchemasBegin
DELETE FROM laboratory.result_status WHERE status = 'No Data';
INSERT INTO laboratory.result_status (status) VALUES ('No Data');
INSERT INTO laboratory.result_status (status) VALUES ('No Data');
-- @SkipOnEmptySchemasEnd
Original file line number Diff line number Diff line change
@@ -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');
INSERT INTO laboratory.species (common_name, scientific_name) VALUES ('Rabbit', 'Lepus curpaeums');
-- @SkipOnEmptySchemasEnd