--
-- PostgreSQL database dump
--

-- Dumped from database version 9.6.21
-- Dumped by pg_dump version 9.6.21

-- Started on 2024-01-15 12:13:00

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 518 (class 1259 OID 1361349)
-- Name: base_partner; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.base_partner (
    id bigint NOT NULL,
    archived boolean,
    import_id character varying(255),
    import_origin character varying(255),
    process_instance_id character varying(255),
    version integer,
    created_on timestamp without time zone,
    updated_on timestamp without time zone,
    attrs jsonb,
    charge_back_purchase numeric(19,2),
    charge_back_purchase_select integer,
    company_str character varying(255),
    contact_attrs jsonb,
    custumer_ref_number character varying(255),
    delivery_comments text,
    delivery_delay integer,
    department character varying(255),
    description text,
    factorized_customer boolean,
    fax character varying(255),
    first_name character varying(255),
    fixed_phone character varying(255),
    full_name character varying(255),
    function_business_card character varying(255),
    group_products_on_printings boolean,
    has_blocked_account boolean,
    has_manually_blocked_account boolean,
    head_office_address character varying(255),
    invoice_comments text,
    invoice_sending_format_select character varying(255),
    invoices_copy_select integer,
    is_carrier boolean,
    is_contact boolean,
    is_customer boolean,
    is_employee boolean,
    is_factor boolean,
    is_internal boolean,
    is_ispm_required boolean,
    is_needing_conformity_certificate boolean,
    is_prospect boolean,
    is_subcontractor boolean,
    is_supplier boolean,
    mobile_phone character varying(255),
    name character varying(255) NOT NULL,
    nbr_employees integer,
    nic character varying(255),
    partner_attrs jsonb,
    partner_seq character varying(255),
    partner_type_select integer,
    password character varying(255),
    payer_quality numeric(19,2),
    payment_delay numeric(19,2),
    picking_order_comments text,
    proforma_comments text,
    purchase_order_comments text,
    purchase_order_information text,
    registration_code character varying(255),
    reject_counter integer,
    sale_order_comments text,
    sale_order_information text,
    sale_turnover integer,
    seller_code character varying(255),
    simple_full_name character varying(255),
    siren character varying(255),
    specific_tax_note text,
    supplier_arrival_product_qty numeric(19,2),
    supplier_quality_rating numeric(19,2),
    supplier_quality_rating_select numeric(19,2),
    tax_nbr character varying(255),
    time_slot text,
    title_select integer,
    web_site character varying(255),
    created_by bigint,
    updated_by bigint,
    active_umr bigint,
    analytic_distribution_template bigint,
    carrier_partner bigint,
    currency bigint,
    das2activity bigint,
    email_address bigint,
    financial_discount bigint,
    fiscal_position bigint,
    freight_carrier_mode bigint,
    in_payment_mode bigint,
    industry_sector bigint,
    job_title_function bigint,
    language bigint,
    main_activity bigint,
    main_address bigint,
    main_partner bigint,
    out_payment_mode bigint,
    parent_partner bigint,
    partner_category bigint,
    payment_condition bigint,
    picture bigint,
    purchase_partner_price_list bigint,
    reports_to bigint,
    sale_partner_price_list bigint,
    shipment_mode bigint,
    source bigint,
    team bigint,
    trading_name bigint,
    user_id bigint,
    CONSTRAINT base_partner_delivery_delay_check CHECK ((delivery_delay >= 0)),
    CONSTRAINT base_partner_nbr_employees_check CHECK ((nbr_employees >= 0))
);


ALTER TABLE public.base_partner OWNER TO postgres;

--
-- TOC entry 6685 (class 2606 OID 1361358)
-- Name: base_partner base_partner_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT base_partner_pkey PRIMARY KEY (id);


--
-- TOC entry 6690 (class 2606 OID 1366778)
-- Name: base_partner uk_7g6wmbcwxu6q898utc275fisj; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT uk_7g6wmbcwxu6q898utc275fisj UNIQUE (import_id);


--
-- TOC entry 6692 (class 2606 OID 1366780)
-- Name: base_partner uk_j701q4v9ypf9dpdsox062eeqg; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT uk_j701q4v9ypf9dpdsox062eeqg UNIQUE (partner_seq);


--
-- TOC entry 6674 (class 1259 OID 1366775)
-- Name: base_partner_das2activity_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_das2activity_idx ON public.base_partner USING btree (das2activity);


--
-- TOC entry 6675 (class 1259 OID 1366767)
-- Name: base_partner_email_address_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_email_address_idx ON public.base_partner USING btree (email_address);


--
-- TOC entry 6676 (class 1259 OID 1366776)
-- Name: base_partner_financial_discount_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_financial_discount_idx ON public.base_partner USING btree (financial_discount);


--
-- TOC entry 6677 (class 1259 OID 1366773)
-- Name: base_partner_fiscal_position_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_fiscal_position_idx ON public.base_partner USING btree (fiscal_position);


--
-- TOC entry 6678 (class 1259 OID 1366772)
-- Name: base_partner_full_name_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_full_name_idx ON public.base_partner USING btree (full_name);


--
-- TOC entry 6679 (class 1259 OID 1366765)
-- Name: base_partner_job_title_function_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_job_title_function_idx ON public.base_partner USING btree (job_title_function);


--
-- TOC entry 6680 (class 1259 OID 1366766)
-- Name: base_partner_language_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_language_idx ON public.base_partner USING btree (language);


--
-- TOC entry 6681 (class 1259 OID 1366770)
-- Name: base_partner_main_activity_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_main_activity_idx ON public.base_partner USING btree (main_activity);


--
-- TOC entry 6682 (class 1259 OID 1366774)
-- Name: base_partner_main_address_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_main_address_idx ON public.base_partner USING btree (main_address);


--
-- TOC entry 6683 (class 1259 OID 1366764)
-- Name: base_partner_partner_category_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_partner_category_idx ON public.base_partner USING btree (partner_category);


--
-- TOC entry 6686 (class 1259 OID 1366769)
-- Name: base_partner_purchase_partner_price_list_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_purchase_partner_price_list_idx ON public.base_partner USING btree (purchase_partner_price_list);


--
-- TOC entry 6687 (class 1259 OID 1366768)
-- Name: base_partner_sale_partner_price_list_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_sale_partner_price_list_idx ON public.base_partner USING btree (sale_partner_price_list);


--
-- TOC entry 6688 (class 1259 OID 1366771)
-- Name: base_partner_trading_name_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX base_partner_trading_name_idx ON public.base_partner USING btree (trading_name);


--
-- TOC entry 6720 (class 2606 OID 1377669)
-- Name: base_partner fk_2cnc2x837impx6c9hobnyifqi; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_2cnc2x837impx6c9hobnyifqi FOREIGN KEY (source) REFERENCES public.base_source(id);


--
-- TOC entry 6713 (class 2606 OID 1377634)
-- Name: base_partner fk_306nf66nt57ibesqfr9wp9voj; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_306nf66nt57ibesqfr9wp9voj FOREIGN KEY (partner_category) REFERENCES public.base_partner_category(id);


--
-- TOC entry 6697 (class 2606 OID 1377554)
-- Name: base_partner fk_3beaydaj768cdr1jc8ktiutw8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_3beaydaj768cdr1jc8ktiutw8 FOREIGN KEY (carrier_partner) REFERENCES public.base_partner(id);


--
-- TOC entry 6711 (class 2606 OID 1377624)
-- Name: base_partner fk_4afn30e7i36bvjv9o14o8b2q3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_4afn30e7i36bvjv9o14o8b2q3 FOREIGN KEY (out_payment_mode) REFERENCES public.account_payment_mode(id);


--
-- TOC entry 6698 (class 2606 OID 1377559)
-- Name: base_partner fk_4frhlaeebfltmkr99g6t9k0uh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_4frhlaeebfltmkr99g6t9k0uh FOREIGN KEY (currency) REFERENCES public.base_currency(id);


--
-- TOC entry 6704 (class 2606 OID 1377589)
-- Name: base_partner fk_4omer6cy9i7yu2dbrwgl13yvf; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_4omer6cy9i7yu2dbrwgl13yvf FOREIGN KEY (in_payment_mode) REFERENCES public.account_payment_mode(id);


--
-- TOC entry 6701 (class 2606 OID 1377574)
-- Name: base_partner fk_7e6goso1g24983dkucdrwac5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_7e6goso1g24983dkucdrwac5 FOREIGN KEY (financial_discount) REFERENCES public.account_financial_discount(id);


--
-- TOC entry 6719 (class 2606 OID 1377664)
-- Name: base_partner fk_820tygsqi36cb083263wfpgfk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_820tygsqi36cb083263wfpgfk FOREIGN KEY (shipment_mode) REFERENCES public.stock_shipment_mode(id);


--
-- TOC entry 6705 (class 2606 OID 1377594)
-- Name: base_partner fk_akdfyx44rpne6vh2f0wg9s81i; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_akdfyx44rpne6vh2f0wg9s81i FOREIGN KEY (industry_sector) REFERENCES public.base_industry_sector(id);


--
-- TOC entry 6693 (class 2606 OID 1377534)
-- Name: base_partner fk_atgt4let4li3093d4f6v46ih6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_atgt4let4li3093d4f6v46ih6 FOREIGN KEY (created_by) REFERENCES public.auth_user(id);


--
-- TOC entry 6709 (class 2606 OID 1377614)
-- Name: base_partner fk_b4tnqs5crhrkx8i1iskpkn4eh; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_b4tnqs5crhrkx8i1iskpkn4eh FOREIGN KEY (main_address) REFERENCES public.base_address(id);


--
-- TOC entry 6700 (class 2606 OID 1377569)
-- Name: base_partner fk_c0hksvy34k6ch7tdiltv2ljo4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_c0hksvy34k6ch7tdiltv2ljo4 FOREIGN KEY (email_address) REFERENCES public.message_email_address(id);


--
-- TOC entry 6699 (class 2606 OID 1377564)
-- Name: base_partner fk_d2chw6q7gy5c40igy8q5juu20; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_d2chw6q7gy5c40igy8q5juu20 FOREIGN KEY (das2activity) REFERENCES public.account_das2_activity(id);


--
-- TOC entry 6714 (class 2606 OID 1377639)
-- Name: base_partner fk_egthowyhrasn3w06k8r1ojer9; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_egthowyhrasn3w06k8r1ojer9 FOREIGN KEY (payment_condition) REFERENCES public.account_payment_condition(id);


--
-- TOC entry 6703 (class 2606 OID 1377584)
-- Name: base_partner fk_erm71u9vbnlfrp0srdbwww0oj; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_erm71u9vbnlfrp0srdbwww0oj FOREIGN KEY (freight_carrier_mode) REFERENCES public.stock_freight_carrier_mode(id);


--
-- TOC entry 6715 (class 2606 OID 1377644)
-- Name: base_partner fk_eybqh2br1dwqkrye48r0we1my; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_eybqh2br1dwqkrye48r0we1my FOREIGN KEY (picture) REFERENCES public.meta_file(id);


--
-- TOC entry 6694 (class 2606 OID 1377539)
-- Name: base_partner fk_fsiivvfmhcbrv7gqxkvnlaahj; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_fsiivvfmhcbrv7gqxkvnlaahj FOREIGN KEY (updated_by) REFERENCES public.auth_user(id);


--
-- TOC entry 6695 (class 2606 OID 1377544)
-- Name: base_partner fk_fuol260dt6pm8q9hv21ncdbao; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_fuol260dt6pm8q9hv21ncdbao FOREIGN KEY (active_umr) REFERENCES public.account_umr(id);


--
-- TOC entry 6706 (class 2606 OID 1377599)
-- Name: base_partner fk_hk4mjlyrg84dbofno16ftlu0a; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_hk4mjlyrg84dbofno16ftlu0a FOREIGN KEY (job_title_function) REFERENCES public.base_function(id);


--
-- TOC entry 6721 (class 2606 OID 1377674)
-- Name: base_partner fk_jxcxcekfg8syje5oqk68ya7ll; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_jxcxcekfg8syje5oqk68ya7ll FOREIGN KEY (team) REFERENCES public.team_team(id);


--
-- TOC entry 6696 (class 2606 OID 1377549)
-- Name: base_partner fk_lok3jje18df5na421s0rng0le; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_lok3jje18df5na421s0rng0le FOREIGN KEY (analytic_distribution_template) REFERENCES public.account_analytic_distribution_template(id);


--
-- TOC entry 6716 (class 2606 OID 1377649)
-- Name: base_partner fk_lpyy19o2y8rqwypxn7196che6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_lpyy19o2y8rqwypxn7196che6 FOREIGN KEY (purchase_partner_price_list) REFERENCES public.base_partner_price_list(id);


--
-- TOC entry 6707 (class 2606 OID 1377604)
-- Name: base_partner fk_m51bnxjeqmgfvuwp44cx5tcwg; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_m51bnxjeqmgfvuwp44cx5tcwg FOREIGN KEY (language) REFERENCES public.base_language(id);


--
-- TOC entry 6702 (class 2606 OID 1377579)
-- Name: base_partner fk_nyebr3cy5c05k1gc2lasmlwyn; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_nyebr3cy5c05k1gc2lasmlwyn FOREIGN KEY (fiscal_position) REFERENCES public.account_fiscal_position(id);


--
-- TOC entry 6718 (class 2606 OID 1377659)
-- Name: base_partner fk_ptkc058ctmheqt01ffnrlp1bb; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_ptkc058ctmheqt01ffnrlp1bb FOREIGN KEY (sale_partner_price_list) REFERENCES public.base_partner_price_list(id);


--
-- TOC entry 6717 (class 2606 OID 1377654)
-- Name: base_partner fk_q19n1kgdd0f5aret7jubvikmp; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_q19n1kgdd0f5aret7jubvikmp FOREIGN KEY (reports_to) REFERENCES public.base_partner(id);


--
-- TOC entry 6710 (class 2606 OID 1377619)
-- Name: base_partner fk_qbmcsdq144d85s7t0hp9198yl; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_qbmcsdq144d85s7t0hp9198yl FOREIGN KEY (main_partner) REFERENCES public.base_partner(id);


--
-- TOC entry 6723 (class 2606 OID 1377684)
-- Name: base_partner fk_sa1lxax8xexdk1lhlrb6v00jt; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_sa1lxax8xexdk1lhlrb6v00jt FOREIGN KEY (user_id) REFERENCES public.auth_user(id);


--
-- TOC entry 6712 (class 2606 OID 1377629)
-- Name: base_partner fk_sawo9ibxhulke70o9hyr79emq; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_sawo9ibxhulke70o9hyr79emq FOREIGN KEY (parent_partner) REFERENCES public.base_partner(id);


--
-- TOC entry 6722 (class 2606 OID 1377679)
-- Name: base_partner fk_tfx4uq84efcsgcsywb31h266q; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_tfx4uq84efcsgcsywb31h266q FOREIGN KEY (trading_name) REFERENCES public.base_trading_name(id);


--
-- TOC entry 6708 (class 2606 OID 1377609)
-- Name: base_partner fk_vjv7r0ukc20mlxkpf0qqey6v; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.base_partner
    ADD CONSTRAINT fk_vjv7r0ukc20mlxkpf0qqey6v FOREIGN KEY (main_activity) REFERENCES public.base_main_activity(id);


-- Completed on 2024-01-15 12:13:01

--
-- PostgreSQL database dump complete
--

