 --
 
 ALTER SEQUENCE catalogs_id_seq OWNED BY catalogs.id;
-
-
---
--- Name: contract_items; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE contract_items (
-    id integer NOT NULL,
-    contract_id integer NOT NULL,
-    variant_id integer NOT NULL,
-    quantity numeric(19,4) DEFAULT 1.0 NOT NULL,
-    unit_pretax_amount numeric(19,4) NOT NULL,
-    pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL,
-    created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL,
-    creator_id integer,
-    updater_id integer,
-    lock_version integer DEFAULT 0 NOT NULL
-);
-
-
---
--- Name: contract_items_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE contract_items_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: contract_items_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE contract_items_id_seq OWNED BY contract_items.id;
-
-
---
--- Name: contract_natures; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE contract_natures (
-    id integer NOT NULL,
-    name character varying NOT NULL,
-    currency character varying NOT NULL,
-    created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL,
-    creator_id integer,
-    updater_id integer,
-    lock_version integer DEFAULT 0 NOT NULL
-);
-
-
---
--- Name: contract_natures_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE contract_natures_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: contract_natures_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE contract_natures_id_seq OWNED BY contract_natures.id;
-
-
---
--- Name: contracts; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE contracts (
-    id integer NOT NULL,
-    nature_id integer NOT NULL,
-    active boolean DEFAULT false NOT NULL,
-    name character varying NOT NULL,
-    number character varying,
-    description character varying,
-    state character varying,
-    reference_number character varying,
-    started_on date,
-    stopped_on date,
-    custom_fields jsonb,
-    pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL,
-    currency character varying NOT NULL,
-    responsible_id integer NOT NULL,
-    supplier_id integer NOT NULL,
-    created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL,
-    creator_id integer,
-    updater_id integer,
-    lock_version integer DEFAULT 0 NOT NULL
-);
-
-
---
--- Name: contracts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE contracts_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: contracts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE contracts_id_seq OWNED BY contracts.id;
 
 
 --

    undelivered_invoice_entry_id integer,
    quantity_gap_on_invoice_entry_id integer,
    payment_delay character varying,
    payment_at timestamp without time zone,
    contract_id integer
);



--

CREATE INDEX index_purchases_on_affair_id ON purchases USING btree (affair_id);


--
