This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
bactdb/migrations/00006_AddCharacteristics_up.sql
Matthew Dillon 2894efaf46 Drop soft-delete
Fixes #13.
2015-10-13 16:03:18 -07:00

23 lines
690 B
SQL

-- bactdb
-- Matthew R Dillon
CREATE TABLE characteristics (
id BIGSERIAL NOT NULL,
characteristic_name TEXT NOT NULL,
characteristic_type_id BIGINT NOT NULL,
sort_order BIGINT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
created_by BIGINT NOT NULL,
updated_by BIGINT NOT NULL,
CONSTRAINT characteristics_pkey PRIMARY KEY (id),
FOREIGN KEY (characteristic_type_id) REFERENCES characteristic_types(id),
FOREIGN KEY (created_by) REFERENCES users(id),
FOREIGN KEY (updated_by) REFERENCES users(id)
);
CREATE INDEX characteristic_type_id_idx ON characteristics (characteristic_type_id);