Renaming observations to characteristics
This commit is contained in:
parent
c1323f9c1f
commit
950b15a117
27 changed files with 889 additions and 889 deletions
|
@ -1,5 +1,5 @@
|
|||
-- bactdb
|
||||
-- Matthew R Dillon
|
||||
|
||||
DROP TABLE observations;
|
||||
DROP TABLE characteristics;
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
-- bactdb
|
||||
-- Matthew R Dillon
|
||||
|
||||
CREATE TABLE observations (
|
||||
CREATE TABLE characteristics (
|
||||
id BIGSERIAL NOT NULL,
|
||||
observation_name CHARACTER VARYING(100) NOT NULL,
|
||||
characteristic_name CHARACTER VARYING(100) NOT NULL,
|
||||
characteristic_type_id BIGINT NOT NULL,
|
||||
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
deleted_at TIMESTAMP WITH TIME ZONE NULL,
|
||||
|
||||
CONSTRAINT observations_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT characteristics_pkey PRIMARY KEY (id),
|
||||
FOREIGN KEY (characteristic_type_id) REFERENCES characteristic_types(id)
|
||||
);
|
||||
|
||||
CREATE INDEX characteristic_type_id_idx ON observations (characteristic_type_id);
|
||||
CREATE INDEX characteristic_type_id_idx ON characteristics (characteristic_type_id);
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
CREATE TABLE measurements (
|
||||
id BIGSERIAL NOT NULL,
|
||||
strain_id BIGINT NOT NULL,
|
||||
observation_id BIGINT NOT NULL,
|
||||
characteristic_id BIGINT NOT NULL,
|
||||
text_measurement_type_id BIGINT NULL,
|
||||
txt_value CHARACTER VARYING(255) NULL,
|
||||
num_value NUMERIC(8, 3) NULL,
|
||||
|
@ -16,9 +16,9 @@ CREATE TABLE measurements (
|
|||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
|
||||
CONSTRAINT strainsobsmeasurements_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT strainscharmeasurements_pkey PRIMARY KEY (id),
|
||||
FOREIGN KEY (strain_id) REFERENCES strains(id),
|
||||
FOREIGN KEY (observation_id) REFERENCES observations(id),
|
||||
FOREIGN KEY (characteristic_id) REFERENCES characteristics(id),
|
||||
FOREIGN KEY (text_measurement_type_id) REFERENCES text_measurement_types(id),
|
||||
FOREIGN KEY (unit_type_id) REFERENCES unit_types(id),
|
||||
FOREIGN KEY (test_method_id) REFERENCES test_methods(id),
|
||||
|
@ -42,7 +42,7 @@ CREATE TABLE measurements (
|
|||
|
||||
CREATE INDEX strain_id_idx ON measurements (strain_id);
|
||||
|
||||
CREATE INDEX observation_id_idx ON measurements (observation_id);
|
||||
CREATE INDEX characteristic_id_idx ON measurements (characteristic_id);
|
||||
|
||||
CREATE INDEX text_measurement_type_id_idx ON measurements (text_measurement_type_id);
|
||||
|
||||
|
|
Reference in a new issue