Authorship

This commit is contained in:
Matthew Dillon 2015-05-13 15:25:02 -08:00
parent 8dc3e2a3fb
commit 1298cffca2
6 changed files with 29 additions and 5 deletions

View file

@ -10,15 +10,20 @@ CREATE TABLE strains (
genbank TEXT NULL,
isolated_from TEXT NULL,
notes TEXT NULL,
author_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,
created_by BIGINT NOT NULL,
updated_by BIGINT NOT NULL,
deleted_by BIGINT NULL,
CONSTRAINT strain_pkey PRIMARY KEY (id),
FOREIGN KEY (species_id) REFERENCES species(id),
FOREIGN KEY (author_id) REFERENCES users(id)
FOREIGN KEY (created_by) REFERENCES users(id),
FOREIGN KEY (updated_by) REFERENCES users(id),
FOREIGN KEY (deleted_by) REFERENCES users(id)
);
CREATE INDEX species_id_idx ON strains (species_id);