CREATE TABLE cartera_individual
(
  id_cartera_individual bigint NOT NULL,
  codigo_cartera bigint,
  codigo_factura character varying(100),
  monto_cartera integer,
  monto_glosa_pagada integer,
  monto_glosa_conciliada integer,
  monto_glosa_aceptada integer,
  monto_glosa_revision integer,
  monto_glosa_revision_aceptada integer,
  monto_glosa_revision_conciliada integer,
  fecha_creacion timestamp without time zone,
  fecha timestamp without time zone,
  usuario character varying,
  CONSTRAINT id_cartera_individual_pk PRIMARY KEY (id_cartera_individual),
  CONSTRAINT codigo_cartera_fk FOREIGN KEY (codigo_cartera)
      REFERENCES cartera (id_cartera) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE cartera_individual
  OWNER TO postgres;

-- Index: fki_codigo_cartera_fk

-- DROP INDEX fki_codigo_cartera_fk;

CREATE INDEX fki_codigo_cartera_fk
  ON cartera_individual
  USING btree
  (codigo_cartera);