-- Sequence: rips_data_id_seq

-- DROP SEQUENCE rips_data_id_seq;

CREATE SEQUENCE rips_data_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;
ALTER TABLE rips_data_id_seq
  OWNER TO postgres;

-- Table: rips_data

-- DROP TABLE rips_data;

CREATE TABLE rips_data
(
  appointment_code character varying(10) NOT NULL,
  rips smallint NOT NULL,
  id integer NOT NULL DEFAULT nextval('rips_data_id_seq'::regclass),
  date_create timestamp without time zone NOT NULL,
  id_user integer NOT NULL,
  CONSTRAINT rips_data_pkey PRIMARY KEY (id),
  CONSTRAINT fk_appointment_code_rips_data FOREIGN KEY (appointment_code)
      REFERENCES appointment (appointment_code) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_user_sonata_rips_data FOREIGN KEY (id_user)
      REFERENCES user_sonata (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE rips_data
  OWNER TO postgres;
