CREATE SEQUENCE {schema}.detctn_seq START 1;

CREATE TABLE {schema}.detections
(
  detection_key bigint,
  datelastmodified character varying,
  date timestamp without time zone,
  code_space character varying,
  id character varying,
  sensor_1 character varying,
  units_1 character varying,
  sensor_2 character varying,
  units_2 character varying,
  transmitter_name character varying,
  transmitter_sn character varying,
  receiver_name character varying,
  receiver_sn character varying,
  CONSTRAINT pkey_detct UNIQUE (detection_key),
  CONSTRAINT unq_dect UNIQUE (date, receiver_sn)
)
WITH (
  OIDS=FALSE
);