Renaming observation types to characteristic types

This commit is contained in:
Matthew Dillon 2014-12-12 10:24:59 -09:00
parent be9e6481d0
commit c1323f9c1f
24 changed files with 873 additions and 873 deletions

View file

@ -0,0 +1,5 @@
-- bactdb
-- Matthew R Dillon
DROP TABLE characteristic_types;

View file

@ -1,14 +1,14 @@
-- bactdb
-- Matthew R Dillon
CREATE TABLE observation_types (
CREATE TABLE characteristic_types (
id BIGSERIAL NOT NULL,
observation_type_name CHARACTER VARYING(100) NOT NULL,
characteristic_type_name CHARACTER VARYING(100) 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 observation_types_pkey PRIMARY KEY (id)
CONSTRAINT characteristic_types_pkey PRIMARY KEY (id)
);

View file

@ -1,5 +0,0 @@
-- bactdb
-- Matthew R Dillon
DROP TABLE observation_types;

View file

@ -4,15 +4,15 @@
CREATE TABLE observations (
id BIGSERIAL NOT NULL,
observation_name CHARACTER VARYING(100) NOT NULL,
observation_type_id BIGINT 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),
FOREIGN KEY (observation_type_id) REFERENCES observation_types(id)
FOREIGN KEY (characteristic_type_id) REFERENCES characteristic_types(id)
);
CREATE INDEX observation_type_id_idx ON observations (observation_type_id);
CREATE INDEX characteristic_type_id_idx ON observations (characteristic_type_id);