-- Name: account_move_send_wizard account_move_send_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_signing_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_signing_user_fkey FOREIGN KEY (signing_user) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_origin_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_origin_move_id_fkey FOREIGN KEY (tax_cash_basis_origin_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_rec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_rec_id_fkey FOREIGN KEY (tax_cash_basis_rec_id) REFERENCES public.account_partial_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_transfer_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_transfer_model_id_fkey FOREIGN KEY (transfer_model_id) REFERENCES public.account_transfer_model(id) ON DELETE SET NULL;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_mov_validate_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_mov_validate_account_move_id_fkey FOREIGN KEY (validate_account_move_id) REFERENCES public.validate_account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_move_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_move_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_multicurrency_revaluation_wizard account_multicurrency_revaluation_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_multicurrency_revaluation_wizard
    ADD CONSTRAINT account_multicurrency_revaluation_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_multicurrency_revaluation_wizard account_multicurrency_revaluation_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_multicurrency_revaluation_wizard
    ADD CONSTRAINT account_multicurrency_revaluation_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_multicurrency_revaluation_wizard account_multicurrency_revaluation_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_multicurrency_revaluation_wizard
    ADD CONSTRAINT account_multicurrency_revaluation_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_online_account account_online_account_account_online_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_account
    ADD CONSTRAINT account_online_account_account_online_link_id_fkey FOREIGN KEY (account_online_link_id) REFERENCES public.account_online_link(id) ON DELETE CASCADE;


--
-- Name: account_online_account account_online_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_account
    ADD CONSTRAINT account_online_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_online_account account_online_account_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_account
    ADD CONSTRAINT account_online_account_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_online_account account_online_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_account
    ADD CONSTRAINT account_online_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_online_link account_online_link_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_link
    ADD CONSTRAINT account_online_link_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_online_link account_online_link_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_link
    ADD CONSTRAINT account_online_link_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_online_link account_online_link_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_online_link
    ADD CONSTRAINT account_online_link_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_currency_id_fkey FOREIGN KEY (credit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_move_id_fkey FOREIGN KEY (credit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_currency_id_fkey FOREIGN KEY (debit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_move_id_fkey FOREIGN KEY (debit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank__account_bank_statement_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank__account_bank_statement_line__fkey FOREIGN KEY (account_bank_statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank_statement__account_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank_statement__account_payment_id_fkey FOREIGN KEY (account_payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_payment account_payment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_payment_method account_payment_method_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method
    ADD CONSTRAINT account_payment_method_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_account_id_fkey FOREIGN KEY (payment_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method account_payment_method_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_method
    ADD CONSTRAINT account_payment_method_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_outstanding_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_outstanding_account_id_fkey FOREIGN KEY (outstanding_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_paired_internal_transfer_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_paired_internal_transfer_payment_id_fkey FOREIGN KEY (paired_internal_transfer_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_transaction_id_fkey FOREIGN KEY (payment_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_custom_user_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_custom_user_currency_id_fkey FOREIGN KEY (custom_user_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_payment_register(id) ON DELETE CASCADE;


--
-- Name: account_payment_register account_payment_register_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment_register account_payment_register_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_source_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_source_currency_id_fkey FOREIGN KEY (source_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_writeoff_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_writeoff_account_id_fkey FOREIGN KEY (writeoff_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_source_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_source_payment_id_fkey FOREIGN KEY (source_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term_line account_payment_term_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term_line account_payment_term_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment_term(id) ON DELETE CASCADE;


--
-- Name: account_payment_term_line account_payment_term_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model account_reconcile_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model account_reconcile_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line__account_reconcile_model_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line__account_reconcile_model_line_fkey FOREIGN KEY (account_reconcile_model_line_id) REFERENCES public.account_reconcile_model_line(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line_account_tax_re_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line_account_tax_re_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model account_reconcile_model_mapped_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_mapped_partner_id_fkey FOREIGN KEY (mapped_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model account_reconcile_model_next_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_next_activity_type_id_fkey FOREIGN KEY (next_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_par_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_par_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model account_reconcile_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_to_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_to_partner_id_fkey FOREIGN KEY (to_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_wizard account_reconcile_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reconcile_wizard
    ADD CONSTRAINT account_reconcile_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_account_report_horizontal_group_rel account_report_account_report_account_report_horizontal_gr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_account_report_horizontal_group_rel
    ADD CONSTRAINT account_report_account_report_account_report_horizontal_gr_fkey FOREIGN KEY (account_report_horizontal_group_id) REFERENCES public.account_report_horizontal_group(id) ON DELETE CASCADE;


--
-- Name: account_report_account_report_horizontal_group_rel account_report_account_report_horizontal_account_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_account_report_horizontal_group_rel
    ADD CONSTRAINT account_report_account_report_horizontal_account_report_id_fkey FOREIGN KEY (account_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_annotation account_report_annotation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_annotation
    ADD CONSTRAINT account_report_annotation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_annotation account_report_annotation_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_annotation
    ADD CONSTRAINT account_report_annotation_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_annotation account_report_annotation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_annotation
    ADD CONSTRAINT account_report_annotation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_budget account_report_budget_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget
    ADD CONSTRAINT account_report_budget_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_report_budget account_report_budget_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget
    ADD CONSTRAINT account_report_budget_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_budget_item account_report_budget_item_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget_item
    ADD CONSTRAINT account_report_budget_item_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_report_budget_item account_report_budget_item_budget_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget_item
    ADD CONSTRAINT account_report_budget_item_budget_id_fkey FOREIGN KEY (budget_id) REFERENCES public.account_report_budget(id) ON DELETE CASCADE;


--
-- Name: account_report_budget_item account_report_budget_item_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget_item
    ADD CONSTRAINT account_report_budget_item_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_budget_item account_report_budget_item_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget_item
    ADD CONSTRAINT account_report_budget_item_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_budget account_report_budget_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_budget
    ADD CONSTRAINT account_report_budget_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_custom_audit_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_custom_audit_action_id_fkey FOREIGN KEY (custom_audit_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_custom_handler_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_custom_handler_model_id_fkey FOREIGN KEY (custom_handler_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: account_report_expression account_report_expression_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_expression account_report_expression_report_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_report_line_id_fkey FOREIGN KEY (report_line_id) REFERENCES public.account_report_line(id) ON DELETE CASCADE;


--
-- Name: account_report_expression account_report_expression_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_carryover_origin_report_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_carryover_origin_report_line_fkey FOREIGN KEY (carryover_origin_report_line_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_report_external_value account_report_external_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_target_report_expression_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_target_report_expression_id_fkey FOREIGN KEY (target_report_expression_id) REFERENCES public.account_report_expression(id) ON DELETE CASCADE;


--
-- Name: account_report_external_value account_report_external_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_file_download_error_wizard account_report_file_download_error_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_file_download_error_wizard
    ADD CONSTRAINT account_report_file_download_error_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_file_download_error_wizard account_report_file_download_error_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_file_download_error_wizard
    ADD CONSTRAINT account_report_file_download_error_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_horizontal_group account_report_horizontal_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_horizontal_group
    ADD CONSTRAINT account_report_horizontal_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_horizontal_group_rule account_report_horizontal_group_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_horizontal_group_rule
    ADD CONSTRAINT account_report_horizontal_group_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_horizontal_group_rule account_report_horizontal_group_rule_horizontal_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_horizontal_group_rule
    ADD CONSTRAINT account_report_horizontal_group_rule_horizontal_group_id_fkey FOREIGN KEY (horizontal_group_id) REFERENCES public.account_report_horizontal_group(id) ON DELETE RESTRICT;


--
-- Name: account_report_horizontal_group_rule account_report_horizontal_group_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_horizontal_group_rule
    ADD CONSTRAINT account_report_horizontal_group_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_horizontal_group account_report_horizontal_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_horizontal_group
    ADD CONSTRAINT account_report_horizontal_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_line account_report_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_root_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_root_report_id_fkey FOREIGN KEY (root_report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_section_rel account_report_section_rel_main_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_main_report_id_fkey FOREIGN KEY (main_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_section_rel account_report_section_rel_sub_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_sub_report_id_fkey FOREIGN KEY (sub_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_send account_report_send_account_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send
    ADD CONSTRAINT account_report_send_account_report_id_fkey FOREIGN KEY (account_report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_send account_report_send_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send
    ADD CONSTRAINT account_report_send_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_send account_report_send_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send
    ADD CONSTRAINT account_report_send_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_report_send_res_partner_rel account_report_send_res_partner_rel_account_report_send_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send_res_partner_rel
    ADD CONSTRAINT account_report_send_res_partner_rel_account_report_send_id_fkey FOREIGN KEY (account_report_send_id) REFERENCES public.account_report_send(id) ON DELETE CASCADE;


--
-- Name: account_report_send_res_partner_rel account_report_send_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send_res_partner_rel
    ADD CONSTRAINT account_report_send_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_report_send account_report_send_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report_send
    ADD CONSTRAINT account_report_send_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reports_export_wizard account_reports_export_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard
    ADD CONSTRAINT account_reports_export_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reports_export_wizard_format account_reports_export_wizard_format_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard_format
    ADD CONSTRAINT account_reports_export_wizard_format_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reports_export_wizard_format account_reports_export_wizard_format_export_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard_format
    ADD CONSTRAINT account_reports_export_wizard_format_export_wizard_id_fkey FOREIGN KEY (export_wizard_id) REFERENCES public.account_reports_export_wizard(id) ON DELETE CASCADE;


--
-- Name: account_reports_export_wizard_format account_reports_export_wizard_format_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard_format
    ADD CONSTRAINT account_reports_export_wizard_format_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reports_export_wizard account_reports_export_wizard_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard
    ADD CONSTRAINT account_reports_export_wizard_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_reports_export_wizard account_reports_export_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_reports_export_wizard
    ADD CONSTRAINT account_reports_export_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_resequence_wizard account_resequence_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_resequence_wizard
    ADD CONSTRAINT account_resequence_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_resequence_wizard account_resequence_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_resequence_wizard
    ADD CONSTRAINT account_resequence_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_check account_return_check_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_check
    ADD CONSTRAINT account_return_check_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_check_res_users_rel account_return_check_res_users_rel_account_return_check_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_check_res_users_rel
    ADD CONSTRAINT account_return_check_res_users_rel_account_return_check_id_fkey FOREIGN KEY (account_return_check_id) REFERENCES public.account_return_check(id) ON DELETE CASCADE;


--
-- Name: account_return_check_res_users_rel account_return_check_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_check_res_users_rel
    ADD CONSTRAINT account_return_check_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: account_return_check account_return_check_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_check
    ADD CONSTRAINT account_return_check_return_id_fkey FOREIGN KEY (return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: account_return_check account_return_check_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_check
    ADD CONSTRAINT account_return_check_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return account_return_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_return account_return_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_creation_wizard account_return_creation_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_creation_wizard
    ADD CONSTRAINT account_return_creation_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_return_creation_wizard account_return_creation_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_creation_wizard
    ADD CONSTRAINT account_return_creation_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_creation_wizard account_return_creation_wizard_return_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_creation_wizard
    ADD CONSTRAINT account_return_creation_wizard_return_type_id_fkey FOREIGN KEY (return_type_id) REFERENCES public.account_return_type(id) ON DELETE CASCADE;


--
-- Name: account_return_creation_wizard account_return_creation_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_creation_wizard
    ADD CONSTRAINT account_return_creation_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_ir_attachment_rel account_return_ir_attachment_rel_account_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_ir_attachment_rel
    ADD CONSTRAINT account_return_ir_attachment_rel_account_return_id_fkey FOREIGN KEY (account_return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: account_return_ir_attachment_rel account_return_ir_attachment_rel_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_ir_attachment_rel
    ADD CONSTRAINT account_return_ir_attachment_rel_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: account_return account_return_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_return_payment_wizard account_return_payment_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_payment_wizard
    ADD CONSTRAINT account_return_payment_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_return_payment_wizard account_return_payment_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_payment_wizard
    ADD CONSTRAINT account_return_payment_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_payment_wizard account_return_payment_wizard_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_payment_wizard
    ADD CONSTRAINT account_return_payment_wizard_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_return_payment_wizard account_return_payment_wizard_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_payment_wizard
    ADD CONSTRAINT account_return_payment_wizard_return_id_fkey FOREIGN KEY (return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: account_return_payment_wizard account_return_payment_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_payment_wizard
    ADD CONSTRAINT account_return_payment_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_res_company_rel account_return_res_company_rel_account_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_res_company_rel
    ADD CONSTRAINT account_return_res_company_rel_account_return_id_fkey FOREIGN KEY (account_return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: account_return_res_company_rel account_return_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_res_company_rel
    ADD CONSTRAINT account_return_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_return_submission_wizard account_return_submission_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_submission_wizard
    ADD CONSTRAINT account_return_submission_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return_submission_wizard account_return_submission_wizard_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_submission_wizard
    ADD CONSTRAINT account_return_submission_wizard_return_id_fkey FOREIGN KEY (return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: account_return_submission_wizard account_return_submission_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_submission_wizard
    ADD CONSTRAINT account_return_submission_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return account_return_tax_unit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_tax_unit_id_fkey FOREIGN KEY (tax_unit_id) REFERENCES public.account_tax_unit(id) ON DELETE SET NULL;


--
-- Name: account_return_type account_return_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_type
    ADD CONSTRAINT account_return_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return account_return_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_type_id_fkey FOREIGN KEY (type_id) REFERENCES public.account_return_type(id) ON DELETE RESTRICT;


--
-- Name: account_return_type account_return_type_payment_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_type
    ADD CONSTRAINT account_return_type_payment_partner_bank_id_fkey FOREIGN KEY (payment_partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_return_type account_return_type_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_type
    ADD CONSTRAINT account_return_type_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_return_type account_return_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return_type
    ADD CONSTRAINT account_return_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_return account_return_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_return
    ADD CONSTRAINT account_return_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_setup_bank_manual_config
    ADD CONSTRAINT account_setup_bank_manual_config_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_res_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_setup_bank_manual_config
    ADD CONSTRAINT account_setup_bank_manual_config_res_partner_bank_id_fkey FOREIGN KEY (res_partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE CASCADE;


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_setup_bank_manual_config
    ADD CONSTRAINT account_setup_bank_manual_config_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_alternatives account_tax_alternatives_dest_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_alternatives
    ADD CONSTRAINT account_tax_alternatives_dest_tax_id_fkey FOREIGN KEY (dest_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_alternatives account_tax_alternatives_src_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_alternatives
    ADD CONSTRAINT account_tax_alternatives_src_tax_id_fkey FOREIGN KEY (src_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax account_tax_cash_basis_transition_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_cash_basis_transition_account_id_fkey FOREIGN KEY (cash_basis_transition_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax account_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_child_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_child_tax_fkey FOREIGN KEY (child_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_parent_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_parent_tax_fkey FOREIGN KEY (parent_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_group account_tax_group_advance_tax_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_advance_tax_payment_account_id_fkey FOREIGN KEY (advance_tax_payment_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_tax_group account_tax_group_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_tax_payable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_payable_account_id_fkey FOREIGN KEY (tax_payable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_tax_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_receivable_account_id_fkey FOREIGN KEY (tax_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: account_tax account_tax_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE RESTRICT;


--
-- Name: account_tax_unit account_tax_unit_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit
    ADD CONSTRAINT account_tax_unit_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: account_tax_unit account_tax_unit_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit
    ADD CONSTRAINT account_tax_unit_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax_unit account_tax_unit_main_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit
    ADD CONSTRAINT account_tax_unit_main_company_id_fkey FOREIGN KEY (main_company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_tax_unit_res_company_rel account_tax_unit_res_company_rel_account_tax_unit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit_res_company_rel
    ADD CONSTRAINT account_tax_unit_res_company_rel_account_tax_unit_id_fkey FOREIGN KEY (account_tax_unit_id) REFERENCES public.account_tax_unit(id) ON DELETE CASCADE;


--
-- Name: account_tax_unit_res_company_rel account_tax_unit_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit_res_company_rel
    ADD CONSTRAINT account_tax_unit_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_tax_unit account_tax_unit_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax_unit
    ADD CONSTRAINT account_tax_unit_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_tax account_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_transfer_model account_transfer_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model
    ADD CONSTRAINT account_transfer_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_transfer_model account_transfer_model_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model
    ADD CONSTRAINT account_transfer_model_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_transfer_model_line account_transfer_model_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line
    ADD CONSTRAINT account_transfer_model_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_transfer_model_line account_transfer_model_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line
    ADD CONSTRAINT account_transfer_model_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_transfer_model_line_res_partner_rel account_transfer_model_line_r_account_transfer_model_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line_res_partner_rel
    ADD CONSTRAINT account_transfer_model_line_r_account_transfer_model_line__fkey FOREIGN KEY (account_transfer_model_line_id) REFERENCES public.account_transfer_model_line(id) ON DELETE CASCADE;


--
-- Name: account_transfer_model_line_res_partner_rel account_transfer_model_line_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line_res_partner_rel
    ADD CONSTRAINT account_transfer_model_line_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_transfer_model_line account_transfer_model_line_transfer_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line
    ADD CONSTRAINT account_transfer_model_line_transfer_model_id_fkey FOREIGN KEY (transfer_model_id) REFERENCES public.account_transfer_model(id) ON DELETE CASCADE;


--
-- Name: account_transfer_model_line account_transfer_model_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model_line
    ADD CONSTRAINT account_transfer_model_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_transfer_model account_transfer_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_transfer_model
    ADD CONSTRAINT account_transfer_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: activity_attachment_rel activity_attachment_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.activity_attachment_rel
    ADD CONSTRAINT activity_attachment_rel_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES public.mail_activity(id) ON DELETE CASCADE;


--
-- Name: activity_attachment_rel activity_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.activity_attachment_rel
    ADD CONSTRAINT activity_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: adjusting_entries__account_move adjusting_entries__account_move_adjusting_entry_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.adjusting_entries__account_move
    ADD CONSTRAINT adjusting_entries__account_move_adjusting_entry_move_id_fkey FOREIGN KEY (adjusting_entry_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: adjusting_entries__account_move adjusting_entries__account_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.adjusting_entries__account_move
    ADD CONSTRAINT adjusting_entries__account_move_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: auth_totp_device auth_totp_device_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_device
    ADD CONSTRAINT auth_totp_device_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: auth_totp_rate_limit_log auth_totp_rate_limit_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_rate_limit_log
    ADD CONSTRAINT auth_totp_rate_limit_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: auth_totp_rate_limit_log auth_totp_rate_limit_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_rate_limit_log
    ADD CONSTRAINT auth_totp_rate_limit_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: auth_totp_rate_limit_log auth_totp_rate_limit_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_rate_limit_log
    ADD CONSTRAINT auth_totp_rate_limit_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: auth_totp_wizard auth_totp_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_wizard
    ADD CONSTRAINT auth_totp_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: auth_totp_wizard auth_totp_wizard_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_wizard
    ADD CONSTRAINT auth_totp_wizard_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: auth_totp_wizard auth_totp_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.auth_totp_wizard
    ADD CONSTRAINT auth_totp_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: barcode_nomenclature barcode_nomenclature_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.barcode_nomenclature
    ADD CONSTRAINT barcode_nomenclature_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: barcode_nomenclature barcode_nomenclature_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.barcode_nomenclature
    ADD CONSTRAINT barcode_nomenclature_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_barcode_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_barcode_nomenclature_id_fkey FOREIGN KEY (barcode_nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_document_layout base_document_layout_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: base_document_layout base_document_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_document_layout base_document_layout_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_report_layout_id_fkey FOREIGN KEY (report_layout_id) REFERENCES public.report_layout(id) ON DELETE SET NULL;


--
-- Name: base_document_layout base_document_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_enable_profiling_wizard
    ADD CONSTRAINT base_enable_profiling_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_enable_profiling_wizard
    ADD CONSTRAINT base_enable_profiling_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_import base_import_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_import
    ADD CONSTRAINT base_import_import_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_import base_import_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_import
    ADD CONSTRAINT base_import_import_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_mapping base_import_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_mapping
    ADD CONSTRAINT base_import_mapping_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_mapping base_import_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_mapping
    ADD CONSTRAINT base_import_mapping_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_module base_import_module_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_module
    ADD CONSTRAINT base_import_module_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_import_module base_import_module_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_import_module
    ADD CONSTRAINT base_import_module_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_export base_language_export_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_export
    ADD CONSTRAINT base_language_export_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_export base_language_export_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_export
    ADD CONSTRAINT base_language_export_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: base_language_export base_language_export_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_export
    ADD CONSTRAINT base_language_export_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_import base_language_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_import
    ADD CONSTRAINT base_language_import_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_import base_language_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_import
    ADD CONSTRAINT base_language_import_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_install base_language_install_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_install
    ADD CONSTRAINT base_language_install_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_language_install_website_rel base_language_install_website_rel_base_language_install_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_install_website_rel
    ADD CONSTRAINT base_language_install_website_rel_base_language_install_id_fkey FOREIGN KEY (base_language_install_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: base_language_install_website_rel base_language_install_website_rel_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_install_website_rel
    ADD CONSTRAINT base_language_install_website_rel_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: base_language_install base_language_install_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_language_install
    ADD CONSTRAINT base_language_install_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_install_request base_module_install_request_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_install_request base_module_install_request_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_install_request base_module_install_request_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: base_module_install_request base_module_install_request_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_install_review base_module_install_review_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_review
    ADD CONSTRAINT base_module_install_review_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_install_review base_module_install_review_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_review
    ADD CONSTRAINT base_module_install_review_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_install_review base_module_install_review_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_install_review
    ADD CONSTRAINT base_module_install_review_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_uninstall base_module_uninstall_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_uninstall
    ADD CONSTRAINT base_module_uninstall_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_uninstall_ir_module_module_rel base_module_uninstall_ir_module_m_base_module_uninstall_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_uninstall_ir_module_module_rel
    ADD CONSTRAINT base_module_uninstall_ir_module_m_base_module_uninstall_id_fkey FOREIGN KEY (base_module_uninstall_id) REFERENCES public.base_module_uninstall(id) ON DELETE CASCADE;


--
-- Name: base_module_uninstall_ir_module_module_rel base_module_uninstall_ir_module_module_ir_module_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_uninstall_ir_module_module_rel
    ADD CONSTRAINT base_module_uninstall_ir_module_module_ir_module_module_id_fkey FOREIGN KEY (ir_module_module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_uninstall base_module_uninstall_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_uninstall
    ADD CONSTRAINT base_module_uninstall_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_update base_module_update_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_update
    ADD CONSTRAINT base_module_update_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_update base_module_update_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_update
    ADD CONSTRAINT base_module_update_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_upgrade base_module_upgrade_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_upgrade
    ADD CONSTRAINT base_module_upgrade_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_module_upgrade base_module_upgrade_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_module_upgrade
    ADD CONSTRAINT base_module_upgrade_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic__base_partner_merge_automatic_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard_res_partner_rel
    ADD CONSTRAINT base_partner_merge_automatic__base_partner_merge_automatic_fkey FOREIGN KEY (base_partner_merge_automatic_wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE CASCADE;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_current_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_current_line_id_fkey FOREIGN KEY (current_line_id) REFERENCES public.base_partner_merge_line(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_dst_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_dst_partner_id_fkey FOREIGN KEY (dst_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic_wizard_res_par_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard_res_partner_rel
    ADD CONSTRAINT base_partner_merge_automatic_wizard_res_par_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_line base_partner_merge_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_line
    ADD CONSTRAINT base_partner_merge_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_line base_partner_merge_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_line
    ADD CONSTRAINT base_partner_merge_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_line base_partner_merge_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.base_partner_merge_line
    ADD CONSTRAINT base_partner_merge_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_blog blog_blog_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_blog
    ADD CONSTRAINT blog_blog_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_blog blog_blog_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_blog
    ADD CONSTRAINT blog_blog_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: blog_blog blog_blog_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_blog
    ADD CONSTRAINT blog_blog_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_post blog_post_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post
    ADD CONSTRAINT blog_post_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: blog_post blog_post_blog_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post
    ADD CONSTRAINT blog_post_blog_id_fkey FOREIGN KEY (blog_id) REFERENCES public.blog_blog(id) ON DELETE CASCADE;


--
-- Name: blog_post_blog_tag_rel blog_post_blog_tag_rel_blog_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post_blog_tag_rel
    ADD CONSTRAINT blog_post_blog_tag_rel_blog_post_id_fkey FOREIGN KEY (blog_post_id) REFERENCES public.blog_post(id) ON DELETE CASCADE;


--
-- Name: blog_post_blog_tag_rel blog_post_blog_tag_rel_blog_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post_blog_tag_rel
    ADD CONSTRAINT blog_post_blog_tag_rel_blog_tag_id_fkey FOREIGN KEY (blog_tag_id) REFERENCES public.blog_tag(id) ON DELETE CASCADE;


--
-- Name: blog_post blog_post_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post
    ADD CONSTRAINT blog_post_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_post blog_post_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post
    ADD CONSTRAINT blog_post_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: blog_post blog_post_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_post
    ADD CONSTRAINT blog_post_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_tag_category blog_tag_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_tag_category
    ADD CONSTRAINT blog_tag_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_tag blog_tag_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_tag
    ADD CONSTRAINT blog_tag_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.blog_tag_category(id) ON DELETE SET NULL;


--
-- Name: blog_tag_category blog_tag_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_tag_category
    ADD CONSTRAINT blog_tag_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_tag blog_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_tag
    ADD CONSTRAINT blog_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: blog_tag blog_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blog_tag
    ADD CONSTRAINT blog_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: bus_bus bus_bus_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.bus_bus
    ADD CONSTRAINT bus_bus_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: bus_bus bus_bus_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.bus_bus
    ADD CONSTRAINT bus_bus_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_own change_password_own_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_own
    ADD CONSTRAINT change_password_own_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_own change_password_own_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_own
    ADD CONSTRAINT change_password_own_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_user change_password_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_user
    ADD CONSTRAINT change_password_user_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_user change_password_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_user
    ADD CONSTRAINT change_password_user_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: change_password_user change_password_user_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_user
    ADD CONSTRAINT change_password_user_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.change_password_wizard(id) ON DELETE CASCADE;


--
-- Name: change_password_user change_password_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_user
    ADD CONSTRAINT change_password_user_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_wizard change_password_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_wizard
    ADD CONSTRAINT change_password_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: change_password_wizard change_password_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.change_password_wizard
    ADD CONSTRAINT change_password_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: choose_delivery_carrier choose_delivery_carrier_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.choose_delivery_carrier
    ADD CONSTRAINT choose_delivery_carrier_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: choose_delivery_carrier choose_delivery_carrier_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.choose_delivery_carrier
    ADD CONSTRAINT choose_delivery_carrier_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: choose_delivery_carrier choose_delivery_carrier_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.choose_delivery_carrier
    ADD CONSTRAINT choose_delivery_carrier_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: choose_delivery_carrier choose_delivery_carrier_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.choose_delivery_carrier
    ADD CONSTRAINT choose_delivery_carrier_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_tag crm_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_tag
    ADD CONSTRAINT crm_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_tag crm_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_tag
    ADD CONSTRAINT crm_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_team crm_team_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team
    ADD CONSTRAINT crm_team_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: crm_team crm_team_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team
    ADD CONSTRAINT crm_team_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_team_member crm_team_member_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team_member
    ADD CONSTRAINT crm_team_member_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_team_member crm_team_member_crm_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team_member
    ADD CONSTRAINT crm_team_member_crm_team_id_fkey FOREIGN KEY (crm_team_id) REFERENCES public.crm_team(id) ON DELETE CASCADE;


--
-- Name: crm_team_member crm_team_member_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team_member
    ADD CONSTRAINT crm_team_member_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: crm_team_member crm_team_member_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team_member
    ADD CONSTRAINT crm_team_member_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_team crm_team_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team
    ADD CONSTRAINT crm_team_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: crm_team crm_team_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.crm_team
    ADD CONSTRAINT crm_team_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: decimal_precision decimal_precision_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.decimal_precision
    ADD CONSTRAINT decimal_precision_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: decimal_precision decimal_precision_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.decimal_precision
    ADD CONSTRAINT decimal_precision_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_carrier delivery_carrier_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier
    ADD CONSTRAINT delivery_carrier_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: delivery_carrier_country_rel delivery_carrier_country_rel_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier_country_rel
    ADD CONSTRAINT delivery_carrier_country_rel_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: delivery_carrier_country_rel delivery_carrier_country_rel_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier_country_rel
    ADD CONSTRAINT delivery_carrier_country_rel_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: delivery_carrier delivery_carrier_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier
    ADD CONSTRAINT delivery_carrier_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_carrier delivery_carrier_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier
    ADD CONSTRAINT delivery_carrier_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: delivery_carrier_state_rel delivery_carrier_state_rel_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier_state_rel
    ADD CONSTRAINT delivery_carrier_state_rel_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: delivery_carrier_state_rel delivery_carrier_state_rel_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier_state_rel
    ADD CONSTRAINT delivery_carrier_state_rel_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: delivery_carrier delivery_carrier_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier
    ADD CONSTRAINT delivery_carrier_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: delivery_carrier delivery_carrier_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_carrier
    ADD CONSTRAINT delivery_carrier_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_price_rule delivery_price_rule_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_price_rule
    ADD CONSTRAINT delivery_price_rule_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: delivery_price_rule delivery_price_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_price_rule
    ADD CONSTRAINT delivery_price_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_price_rule delivery_price_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_price_rule
    ADD CONSTRAINT delivery_price_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_zip_prefix delivery_zip_prefix_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_zip_prefix
    ADD CONSTRAINT delivery_zip_prefix_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: delivery_zip_prefix_rel delivery_zip_prefix_rel_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_zip_prefix_rel
    ADD CONSTRAINT delivery_zip_prefix_rel_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: delivery_zip_prefix_rel delivery_zip_prefix_rel_zip_prefix_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_zip_prefix_rel
    ADD CONSTRAINT delivery_zip_prefix_rel_zip_prefix_id_fkey FOREIGN KEY (zip_prefix_id) REFERENCES public.delivery_zip_prefix(id) ON DELETE CASCADE;


--
-- Name: delivery_zip_prefix delivery_zip_prefix_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.delivery_zip_prefix
    ADD CONSTRAINT delivery_zip_prefix_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: digest_digest digest_digest_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_digest
    ADD CONSTRAINT digest_digest_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: digest_digest digest_digest_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_digest
    ADD CONSTRAINT digest_digest_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: digest_digest_res_users_rel digest_digest_res_users_rel_digest_digest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_digest_res_users_rel
    ADD CONSTRAINT digest_digest_res_users_rel_digest_digest_id_fkey FOREIGN KEY (digest_digest_id) REFERENCES public.digest_digest(id) ON DELETE CASCADE;


--
-- Name: digest_digest_res_users_rel digest_digest_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_digest_res_users_rel
    ADD CONSTRAINT digest_digest_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: digest_digest digest_digest_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_digest
    ADD CONSTRAINT digest_digest_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: digest_tip digest_tip_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_tip
    ADD CONSTRAINT digest_tip_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: digest_tip digest_tip_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_tip
    ADD CONSTRAINT digest_tip_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE SET NULL;


--
-- Name: digest_tip_res_users_rel digest_tip_res_users_rel_digest_tip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_tip_res_users_rel
    ADD CONSTRAINT digest_tip_res_users_rel_digest_tip_id_fkey FOREIGN KEY (digest_tip_id) REFERENCES public.digest_tip(id) ON DELETE CASCADE;


--
-- Name: digest_tip_res_users_rel digest_tip_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_tip_res_users_rel
    ADD CONSTRAINT digest_tip_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: digest_tip digest_tip_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.digest_tip
    ADD CONSTRAINT digest_tip_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_call_history discuss_call_history_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_call_history
    ADD CONSTRAINT discuss_call_history_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_call_history discuss_call_history_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_call_history
    ADD CONSTRAINT discuss_call_history_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_call_history discuss_call_history_start_call_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_call_history
    ADD CONSTRAINT discuss_call_history_start_call_message_id_fkey FOREIGN KEY (start_call_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: discuss_call_history discuss_call_history_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_call_history
    ADD CONSTRAINT discuss_call_history_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_from_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_from_message_id_fkey FOREIGN KEY (from_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_group_public_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_group_public_id_fkey FOREIGN KEY (group_public_id) REFERENCES public.res_groups(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_member discuss_channel_member_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_fetched_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_fetched_message_id_fkey FOREIGN KEY (fetched_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_member discuss_channel_member_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_member discuss_channel_member_rtc_inviting_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_rtc_inviting_session_id_fkey FOREIGN KEY (rtc_inviting_session_id) REFERENCES public.discuss_channel_rtc_session(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_seen_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_seen_message_id_fkey FOREIGN KEY (seen_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_member discuss_channel_member_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_member
    ADD CONSTRAINT discuss_channel_member_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_parent_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_parent_channel_id_fkey FOREIGN KEY (parent_channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_res_groups_rel discuss_channel_res_groups_rel_discuss_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_res_groups_rel
    ADD CONSTRAINT discuss_channel_res_groups_rel_discuss_channel_id_fkey FOREIGN KEY (discuss_channel_id) REFERENCES public.discuss_channel(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_res_groups_rel discuss_channel_res_groups_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_res_groups_rel
    ADD CONSTRAINT discuss_channel_res_groups_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_channel_member_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_channel_member_id_fkey FOREIGN KEY (channel_member_id) REFERENCES public.discuss_channel_member(id) ON DELETE CASCADE;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: discuss_channel_rtc_session discuss_channel_rtc_session_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel_rtc_session
    ADD CONSTRAINT discuss_channel_rtc_session_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_channel discuss_channel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_channel
    ADD CONSTRAINT discuss_channel_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_gif_favorite discuss_gif_favorite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_gif_favorite
    ADD CONSTRAINT discuss_gif_favorite_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_gif_favorite discuss_gif_favorite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_gif_favorite
    ADD CONSTRAINT discuss_gif_favorite_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_voice_metadata discuss_voice_metadata_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_voice_metadata
    ADD CONSTRAINT discuss_voice_metadata_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: discuss_voice_metadata discuss_voice_metadata_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_voice_metadata
    ADD CONSTRAINT discuss_voice_metadata_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: discuss_voice_metadata discuss_voice_metadata_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.discuss_voice_metadata
    ADD CONSTRAINT discuss_voice_metadata_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: dms_acc_rep_export_wizard_format_rel dms_acc_rep_export_wizard_fo_account_reports_export_wizar_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dms_acc_rep_export_wizard_format_rel
    ADD CONSTRAINT dms_acc_rep_export_wizard_fo_account_reports_export_wizar_fkey1 FOREIGN KEY (account_reports_export_wizard_format_id) REFERENCES public.account_reports_export_wizard_format(id) ON DELETE CASCADE;


--
-- Name: dms_acc_rep_export_wizard_format_rel dms_acc_rep_export_wizard_for_account_reports_export_wizar_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dms_acc_rep_export_wizard_format_rel
    ADD CONSTRAINT dms_acc_rep_export_wizard_for_account_reports_export_wizar_fkey FOREIGN KEY (account_reports_export_wizard_id) REFERENCES public.account_reports_export_wizard(id) ON DELETE CASCADE;


--
-- Name: email_template_attachment_rel email_template_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.email_template_attachment_rel
    ADD CONSTRAINT email_template_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: email_template_attachment_rel email_template_attachment_rel_email_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.email_template_attachment_rel
    ADD CONSTRAINT email_template_attachment_rel_email_template_id_fkey FOREIGN KEY (email_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: event_event event_event_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_address_id_fkey FOREIGN KEY (address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_event_slot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_event_slot_id_fkey FOREIGN KEY (event_slot_id) REFERENCES public.event_slot(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_event_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_event_ticket_id_fkey FOREIGN KEY (event_ticket_id) REFERENCES public.event_event_ticket(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: event_event_configurator event_event_configurator_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_configurator
    ADD CONSTRAINT event_event_configurator_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event_event_tag_rel event_event_event_tag_rel_event_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_event_tag_rel
    ADD CONSTRAINT event_event_event_tag_rel_event_event_id_fkey FOREIGN KEY (event_event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: event_event_event_tag_rel event_event_event_tag_rel_event_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_event_tag_rel
    ADD CONSTRAINT event_event_event_tag_rel_event_tag_id_fkey FOREIGN KEY (event_tag_id) REFERENCES public.event_tag(id) ON DELETE CASCADE;


--
-- Name: event_event event_event_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.website_menu(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_organizer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_organizer_id_fkey FOREIGN KEY (organizer_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.event_stage(id) ON DELETE RESTRICT;


--
-- Name: event_event_ticket event_event_ticket_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_ticket
    ADD CONSTRAINT event_event_ticket_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event_ticket event_event_ticket_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_ticket
    ADD CONSTRAINT event_event_ticket_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: event_event_ticket event_event_ticket_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_ticket
    ADD CONSTRAINT event_event_ticket_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE SET NULL;


--
-- Name: event_event_ticket event_event_ticket_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_ticket
    ADD CONSTRAINT event_event_ticket_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: event_event_ticket event_event_ticket_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event_ticket
    ADD CONSTRAINT event_event_ticket_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_event event_event_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: event_event event_event_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_event
    ADD CONSTRAINT event_event_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail event_mail_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail
    ADD CONSTRAINT event_mail_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail event_mail_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail
    ADD CONSTRAINT event_mail_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: event_mail event_mail_last_registration_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail
    ADD CONSTRAINT event_mail_last_registration_id_fkey FOREIGN KEY (last_registration_id) REFERENCES public.event_registration(id) ON DELETE SET NULL;


--
-- Name: event_mail_registration event_mail_registration_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_registration
    ADD CONSTRAINT event_mail_registration_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail_registration event_mail_registration_registration_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_registration
    ADD CONSTRAINT event_mail_registration_registration_id_fkey FOREIGN KEY (registration_id) REFERENCES public.event_registration(id) ON DELETE CASCADE;


--
-- Name: event_mail_registration event_mail_registration_scheduler_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_registration
    ADD CONSTRAINT event_mail_registration_scheduler_id_fkey FOREIGN KEY (scheduler_id) REFERENCES public.event_mail(id) ON DELETE CASCADE;


--
-- Name: event_mail_registration event_mail_registration_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_registration
    ADD CONSTRAINT event_mail_registration_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail_slot event_mail_slot_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_slot
    ADD CONSTRAINT event_mail_slot_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail_slot event_mail_slot_event_slot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_slot
    ADD CONSTRAINT event_mail_slot_event_slot_id_fkey FOREIGN KEY (event_slot_id) REFERENCES public.event_slot(id) ON DELETE CASCADE;


--
-- Name: event_mail_slot event_mail_slot_last_registration_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_slot
    ADD CONSTRAINT event_mail_slot_last_registration_id_fkey FOREIGN KEY (last_registration_id) REFERENCES public.event_registration(id) ON DELETE SET NULL;


--
-- Name: event_mail_slot event_mail_slot_scheduler_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_slot
    ADD CONSTRAINT event_mail_slot_scheduler_id_fkey FOREIGN KEY (scheduler_id) REFERENCES public.event_mail(id) ON DELETE CASCADE;


--
-- Name: event_mail_slot event_mail_slot_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail_slot
    ADD CONSTRAINT event_mail_slot_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_mail event_mail_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_mail
    ADD CONSTRAINT event_mail_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_question_answer event_question_answer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question_answer
    ADD CONSTRAINT event_question_answer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_question_answer event_question_answer_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question_answer
    ADD CONSTRAINT event_question_answer_question_id_fkey FOREIGN KEY (question_id) REFERENCES public.event_question(id) ON DELETE CASCADE;


--
-- Name: event_question_answer event_question_answer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question_answer
    ADD CONSTRAINT event_question_answer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_question event_question_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question
    ADD CONSTRAINT event_question_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_question event_question_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question
    ADD CONSTRAINT event_question_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: event_question event_question_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question
    ADD CONSTRAINT event_question_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE CASCADE;


--
-- Name: event_question event_question_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_question
    ADD CONSTRAINT event_question_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_registration_answer event_registration_answer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration_answer
    ADD CONSTRAINT event_registration_answer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_registration_answer event_registration_answer_question_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration_answer
    ADD CONSTRAINT event_registration_answer_question_id_fkey FOREIGN KEY (question_id) REFERENCES public.event_question(id) ON DELETE RESTRICT;


--
-- Name: event_registration_answer event_registration_answer_registration_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration_answer
    ADD CONSTRAINT event_registration_answer_registration_id_fkey FOREIGN KEY (registration_id) REFERENCES public.event_registration(id) ON DELETE CASCADE;


--
-- Name: event_registration_answer event_registration_answer_value_answer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration_answer
    ADD CONSTRAINT event_registration_answer_value_answer_id_fkey FOREIGN KEY (value_answer_id) REFERENCES public.event_question_answer(id) ON DELETE SET NULL;


--
-- Name: event_registration_answer event_registration_answer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration_answer
    ADD CONSTRAINT event_registration_answer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE RESTRICT;


--
-- Name: event_registration event_registration_event_slot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_event_slot_id_fkey FOREIGN KEY (event_slot_id) REFERENCES public.event_slot(id) ON DELETE RESTRICT;


--
-- Name: event_registration event_registration_event_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_event_ticket_id_fkey FOREIGN KEY (event_ticket_id) REFERENCES public.event_event_ticket(id) ON DELETE RESTRICT;


--
-- Name: event_registration event_registration_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: event_registration event_registration_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: event_registration event_registration_utm_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_utm_campaign_id_fkey FOREIGN KEY (utm_campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_utm_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_utm_medium_id_fkey FOREIGN KEY (utm_medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_utm_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_utm_source_id_fkey FOREIGN KEY (utm_source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_visitor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_visitor_id_fkey FOREIGN KEY (visitor_id) REFERENCES public.website_visitor(id) ON DELETE SET NULL;


--
-- Name: event_registration event_registration_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_registration
    ADD CONSTRAINT event_registration_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_slot event_slot_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_slot
    ADD CONSTRAINT event_slot_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_slot event_slot_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_slot
    ADD CONSTRAINT event_slot_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: event_slot event_slot_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_slot
    ADD CONSTRAINT event_slot_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_stage event_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_stage
    ADD CONSTRAINT event_stage_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_stage event_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_stage
    ADD CONSTRAINT event_stage_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_tag_category event_tag_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag_category
    ADD CONSTRAINT event_tag_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_tag event_tag_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag
    ADD CONSTRAINT event_tag_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.event_tag_category(id) ON DELETE CASCADE;


--
-- Name: event_tag_category event_tag_category_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag_category
    ADD CONSTRAINT event_tag_category_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: event_tag_category event_tag_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag_category
    ADD CONSTRAINT event_tag_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_tag event_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag
    ADD CONSTRAINT event_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_tag_event_type_rel event_tag_event_type_rel_event_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag_event_type_rel
    ADD CONSTRAINT event_tag_event_type_rel_event_tag_id_fkey FOREIGN KEY (event_tag_id) REFERENCES public.event_tag(id) ON DELETE CASCADE;


--
-- Name: event_tag_event_type_rel event_tag_event_type_rel_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag_event_type_rel
    ADD CONSTRAINT event_tag_event_type_rel_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE CASCADE;


--
-- Name: event_tag event_tag_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag
    ADD CONSTRAINT event_tag_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: event_tag event_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_tag
    ADD CONSTRAINT event_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type event_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type
    ADD CONSTRAINT event_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type_mail event_type_mail_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_mail
    ADD CONSTRAINT event_type_mail_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type_mail event_type_mail_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_mail
    ADD CONSTRAINT event_type_mail_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE CASCADE;


--
-- Name: event_type_mail event_type_mail_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_mail
    ADD CONSTRAINT event_type_mail_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type_ticket event_type_ticket_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_ticket
    ADD CONSTRAINT event_type_ticket_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type_ticket event_type_ticket_event_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_ticket
    ADD CONSTRAINT event_type_ticket_event_type_id_fkey FOREIGN KEY (event_type_id) REFERENCES public.event_type(id) ON DELETE CASCADE;


--
-- Name: event_type_ticket event_type_ticket_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_ticket
    ADD CONSTRAINT event_type_ticket_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: event_type_ticket event_type_ticket_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type_ticket
    ADD CONSTRAINT event_type_ticket_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: event_type event_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.event_type
    ADD CONSTRAINT event_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: fetchmail_server fetchmail_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.fetchmail_server
    ADD CONSTRAINT fetchmail_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: fetchmail_server fetchmail_server_object_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.fetchmail_server
    ADD CONSTRAINT fetchmail_server_object_id_fkey FOREIGN KEY (object_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: fetchmail_server fetchmail_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.fetchmail_server
    ADD CONSTRAINT fetchmail_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: header_footer_quotation_template_rel header_footer_quotation_template_re_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.header_footer_quotation_template_rel
    ADD CONSTRAINT header_footer_quotation_template_re_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: header_footer_quotation_template_rel header_footer_quotation_template_rel_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.header_footer_quotation_template_rel
    ADD CONSTRAINT header_footer_quotation_template_rel_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


--
-- Name: iap_account iap_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_account_res_company_rel iap_account_res_company_rel_iap_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account_res_company_rel
    ADD CONSTRAINT iap_account_res_company_rel_iap_account_id_fkey FOREIGN KEY (iap_account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: iap_account_res_company_rel iap_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account_res_company_rel
    ADD CONSTRAINT iap_account_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: iap_account_res_users_rel iap_account_res_users_rel_iap_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account_res_users_rel
    ADD CONSTRAINT iap_account_res_users_rel_iap_account_id_fkey FOREIGN KEY (iap_account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: iap_account_res_users_rel iap_account_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account_res_users_rel
    ADD CONSTRAINT iap_account_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: iap_account iap_account_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.iap_service(id) ON DELETE RESTRICT;


--
-- Name: iap_account iap_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_account
    ADD CONSTRAINT iap_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_extracted_words iap_extracted_words_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_extracted_words
    ADD CONSTRAINT iap_extracted_words_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_extracted_words iap_extracted_words_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_extracted_words
    ADD CONSTRAINT iap_extracted_words_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_service iap_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_service
    ADD CONSTRAINT iap_service_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: iap_service iap_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.iap_service
    ADD CONSTRAINT iap_service_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_client ir_act_client_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_client ir_act_client_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_client ir_act_client_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_client
    ADD CONSTRAINT ir_act_client_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_report_xml ir_act_report_xml_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_paperformat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_paperformat_id_fkey FOREIGN KEY (paperformat_id) REFERENCES public.report_paperformat(id) ON DELETE SET NULL;


--
-- Name: ir_act_report_xml ir_act_report_xml_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_report_xml
    ADD CONSTRAINT ir_act_report_xml_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: ir_act_server ir_act_server_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_activity_user_id_fkey FOREIGN KEY (activity_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_crud_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_crud_model_id_fkey FOREIGN KEY (crud_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: ir_act_server_group_rel ir_act_server_group_rel_act_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_group_rel
    ADD CONSTRAINT ir_act_server_group_rel_act_id_fkey FOREIGN KEY (act_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_group_rel ir_act_server_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_group_rel
    ADD CONSTRAINT ir_act_server_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_link_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_link_field_id_fkey FOREIGN KEY (link_field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_res_partner_rel ir_act_server_res_partner_rel_ir_act_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_res_partner_rel
    ADD CONSTRAINT ir_act_server_res_partner_rel_ir_act_server_id_fkey FOREIGN KEY (ir_act_server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_res_partner_rel ir_act_server_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_res_partner_rel
    ADD CONSTRAINT ir_act_server_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_selection_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_selection_value_fkey FOREIGN KEY (selection_value) REFERENCES public.ir_model_fields_selection(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_sequence_id_fkey FOREIGN KEY (sequence_id) REFERENCES public.ir_sequence(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: ir_act_server ir_act_server_update_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_update_field_id_fkey FOREIGN KEY (update_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_update_related_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_update_related_model_id_fkey FOREIGN KEY (update_related_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: ir_act_server_webhook_field_rel ir_act_server_webhook_field_rel_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_webhook_field_rel
    ADD CONSTRAINT ir_act_server_webhook_field_rel_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_act_server_webhook_field_rel ir_act_server_webhook_field_rel_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server_webhook_field_rel
    ADD CONSTRAINT ir_act_server_webhook_field_rel_server_id_fkey FOREIGN KEY (server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: ir_act_server ir_act_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_server
    ADD CONSTRAINT ir_act_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_url ir_act_url_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_url ir_act_url_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_url ir_act_url_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_url
    ADD CONSTRAINT ir_act_url_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_act_window ir_act_window_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_group_rel ir_act_window_group_rel_act_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_group_rel
    ADD CONSTRAINT ir_act_window_group_rel_act_id_fkey FOREIGN KEY (act_id) REFERENCES public.ir_act_window(id) ON DELETE CASCADE;


--
-- Name: ir_act_window_group_rel ir_act_window_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_group_rel
    ADD CONSTRAINT ir_act_window_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_act_window ir_act_window_search_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_search_view_id_fkey FOREIGN KEY (search_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_act_window_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_act_window_id_fkey FOREIGN KEY (act_window_id) REFERENCES public.ir_act_window(id) ON DELETE CASCADE;


--
-- Name: ir_act_window_view ir_act_window_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_act_window_view ir_act_window_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window_view
    ADD CONSTRAINT ir_act_window_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_act_window ir_act_window_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_act_window
    ADD CONSTRAINT ir_act_window_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions ir_actions_binding_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_binding_model_id_fkey FOREIGN KEY (binding_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_actions ir_actions_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions_todo ir_actions_todo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_actions_todo
    ADD CONSTRAINT ir_actions_todo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions_todo ir_actions_todo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_actions_todo
    ADD CONSTRAINT ir_actions_todo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_actions ir_actions_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_actions
    ADD CONSTRAINT ir_actions_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_asset(id) ON DELETE SET NULL;


--
-- Name: ir_asset ir_asset_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: ir_asset ir_asset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_asset
    ADD CONSTRAINT ir_asset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_original_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_original_id_fkey FOREIGN KEY (original_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_attachment(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: ir_attachment ir_attachment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_attachment
    ADD CONSTRAINT ir_attachment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_config_parameter ir_config_parameter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_config_parameter
    ADD CONSTRAINT ir_config_parameter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_config_parameter ir_config_parameter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_config_parameter
    ADD CONSTRAINT ir_config_parameter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_ir_actions_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_ir_actions_server_id_fkey FOREIGN KEY (ir_actions_server_id) REFERENCES public.ir_act_server(id) ON DELETE RESTRICT;


--
-- Name: ir_cron_progress ir_cron_progress_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_progress
    ADD CONSTRAINT ir_cron_progress_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron_progress ir_cron_progress_cron_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_progress
    ADD CONSTRAINT ir_cron_progress_cron_id_fkey FOREIGN KEY (cron_id) REFERENCES public.ir_cron(id) ON DELETE CASCADE;


--
-- Name: ir_cron_progress ir_cron_progress_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_progress
    ADD CONSTRAINT ir_cron_progress_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron_trigger ir_cron_trigger_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron_trigger ir_cron_trigger_cron_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_cron_id_fkey FOREIGN KEY (cron_id) REFERENCES public.ir_cron(id) ON DELETE CASCADE;


--
-- Name: ir_cron_trigger ir_cron_trigger_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron_trigger
    ADD CONSTRAINT ir_cron_trigger_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_cron ir_cron_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: ir_cron ir_cron_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_cron
    ADD CONSTRAINT ir_cron_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_default ir_default_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_default ir_default_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_default ir_default_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_default
    ADD CONSTRAINT ir_default_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo ir_demo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo
    ADD CONSTRAINT ir_demo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_demo_failure_wizard ir_demo_failure_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure_wizard
    ADD CONSTRAINT ir_demo_failure_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.ir_demo_failure_wizard(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure_wizard ir_demo_failure_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure_wizard
    ADD CONSTRAINT ir_demo_failure_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo_failure ir_demo_failure_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo_failure
    ADD CONSTRAINT ir_demo_failure_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_demo ir_demo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_demo
    ADD CONSTRAINT ir_demo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_embedded_actions ir_embedded_actions_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions
    ADD CONSTRAINT ir_embedded_actions_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_embedded_actions ir_embedded_actions_parent_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions
    ADD CONSTRAINT ir_embedded_actions_parent_action_id_fkey FOREIGN KEY (parent_action_id) REFERENCES public.ir_act_window(id) ON DELETE CASCADE;


--
-- Name: ir_embedded_actions_res_groups_rel ir_embedded_actions_res_groups_rel_ir_embedded_actions_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions_res_groups_rel
    ADD CONSTRAINT ir_embedded_actions_res_groups_rel_ir_embedded_actions_id_fkey FOREIGN KEY (ir_embedded_actions_id) REFERENCES public.ir_embedded_actions(id) ON DELETE CASCADE;


--
-- Name: ir_embedded_actions_res_groups_rel ir_embedded_actions_res_groups_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions_res_groups_rel
    ADD CONSTRAINT ir_embedded_actions_res_groups_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_embedded_actions ir_embedded_actions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions
    ADD CONSTRAINT ir_embedded_actions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_embedded_actions ir_embedded_actions_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_embedded_actions
    ADD CONSTRAINT ir_embedded_actions_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports ir_exports_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_exports
    ADD CONSTRAINT ir_exports_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports_line ir_exports_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports_line ir_exports_line_export_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_export_id_fkey FOREIGN KEY (export_id) REFERENCES public.ir_exports(id) ON DELETE CASCADE;


--
-- Name: ir_exports_line ir_exports_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_exports_line
    ADD CONSTRAINT ir_exports_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_exports ir_exports_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_exports
    ADD CONSTRAINT ir_exports_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_filters ir_filters_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_filters ir_filters_embedded_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_embedded_action_id_fkey FOREIGN KEY (embedded_action_id) REFERENCES public.ir_embedded_actions(id) ON DELETE CASCADE;


--
-- Name: ir_filters_res_users_rel ir_filters_res_users_rel_ir_filters_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_filters_res_users_rel
    ADD CONSTRAINT ir_filters_res_users_rel_ir_filters_id_fkey FOREIGN KEY (ir_filters_id) REFERENCES public.ir_filters(id) ON DELETE CASCADE;


--
-- Name: ir_filters_res_users_rel ir_filters_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_filters_res_users_rel
    ADD CONSTRAINT ir_filters_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_filters ir_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_filters
    ADD CONSTRAINT ir_filters_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_mail_server ir_mail_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_mail_server
    ADD CONSTRAINT ir_mail_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_mail_server ir_mail_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_mail_server
    ADD CONSTRAINT ir_mail_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_access ir_model_access_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_access ir_model_access_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE RESTRICT;


--
-- Name: ir_model_access ir_model_access_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_access ir_model_access_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_access
    ADD CONSTRAINT ir_model_access_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_constraint ir_model_constraint_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_constraint ir_model_constraint_model_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_model_fkey FOREIGN KEY (model) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_constraint ir_model_constraint_module_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_module_fkey FOREIGN KEY (module) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_model_constraint ir_model_constraint_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_constraint
    ADD CONSTRAINT ir_model_constraint_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model ir_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_data ir_model_data_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_data
    ADD CONSTRAINT ir_model_data_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_data ir_model_data_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_data
    ADD CONSTRAINT ir_model_data_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields ir_model_fields_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields_group_rel ir_model_fields_group_rel_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields_group_rel
    ADD CONSTRAINT ir_model_fields_group_rel_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_group_rel ir_model_fields_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields_group_rel
    ADD CONSTRAINT ir_model_fields_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_related_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_related_field_id_fkey FOREIGN KEY (related_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields ir_model_fields_relation_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_relation_field_id_fkey FOREIGN KEY (relation_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_fields_selection ir_model_fields_selection_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields_selection
    ADD CONSTRAINT ir_model_fields_selection_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_fields ir_model_fields_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_fields
    ADD CONSTRAINT ir_model_fields_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_inherit ir_model_inherit_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_inherit
    ADD CONSTRAINT ir_model_inherit_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_inherit ir_model_inherit_parent_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_inherit
    ADD CONSTRAINT ir_model_inherit_parent_field_id_fkey FOREIGN KEY (parent_field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: ir_model_inherit ir_model_inherit_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_inherit
    ADD CONSTRAINT ir_model_inherit_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_relation ir_model_relation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_relation ir_model_relation_model_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_model_fkey FOREIGN KEY (model) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model_relation ir_model_relation_module_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_module_fkey FOREIGN KEY (module) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_model_relation ir_model_relation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_relation
    ADD CONSTRAINT ir_model_relation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_model_spreadsheet_dashboard_rel ir_model_spreadsheet_dashboard_re_spreadsheet_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_spreadsheet_dashboard_rel
    ADD CONSTRAINT ir_model_spreadsheet_dashboard_re_spreadsheet_dashboard_id_fkey FOREIGN KEY (spreadsheet_dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: ir_model_spreadsheet_dashboard_rel ir_model_spreadsheet_dashboard_rel_ir_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model_spreadsheet_dashboard_rel
    ADD CONSTRAINT ir_model_spreadsheet_dashboard_rel_ir_model_id_fkey FOREIGN KEY (ir_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_model ir_model_website_form_default_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_website_form_default_field_id_fkey FOREIGN KEY (website_form_default_field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: ir_model ir_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_model
    ADD CONSTRAINT ir_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: ir_module_category ir_module_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_category
    ADD CONSTRAINT ir_module_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module_dependency ir_module_module_dependency_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module_dependency
    ADD CONSTRAINT ir_module_module_dependency_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: ir_module_module_exclusion ir_module_module_exclusion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module_exclusion
    ADD CONSTRAINT ir_module_module_exclusion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_module_module ir_module_module_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_module_module
    ADD CONSTRAINT ir_module_module_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_rule ir_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_rule ir_rule_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: ir_rule ir_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_rule
    ADD CONSTRAINT ir_rule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_sequence_id_fkey FOREIGN KEY (sequence_id) REFERENCES public.ir_sequence(id) ON DELETE CASCADE;


--
-- Name: ir_sequence_date_range ir_sequence_date_range_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence_date_range
    ADD CONSTRAINT ir_sequence_date_range_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_sequence ir_sequence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_sequence
    ADD CONSTRAINT ir_sequence_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_menu ir_ui_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_menu_group_rel ir_ui_menu_group_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_menu_group_rel
    ADD CONSTRAINT ir_ui_menu_group_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_ui_menu_group_rel ir_ui_menu_group_rel_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_menu_group_rel
    ADD CONSTRAINT ir_ui_menu_group_rel_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.ir_ui_menu(id) ON DELETE CASCADE;


--
-- Name: ir_ui_menu ir_ui_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.ir_ui_menu(id) ON DELETE RESTRICT;


--
-- Name: ir_ui_menu ir_ui_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_menu
    ADD CONSTRAINT ir_ui_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view ir_ui_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_ref_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_ref_id_fkey FOREIGN KEY (ref_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_custom ir_ui_view_custom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_custom
    ADD CONSTRAINT ir_ui_view_custom_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view_group_rel ir_ui_view_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_group_rel
    ADD CONSTRAINT ir_ui_view_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view_group_rel ir_ui_view_group_rel_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view_group_rel
    ADD CONSTRAINT ir_ui_view_group_rel_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view ir_ui_view_inherit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_inherit_id_fkey FOREIGN KEY (inherit_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: ir_ui_view ir_ui_view_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: ir_ui_view ir_ui_view_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: ir_ui_view ir_ui_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ir_ui_view
    ADD CONSTRAINT ir_ui_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: mail_activity mail_activity_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan mail_activity_plan_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan
    ADD CONSTRAINT mail_activity_plan_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan mail_activity_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan
    ADD CONSTRAINT mail_activity_plan_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan_mail_activity_schedule_rel mail_activity_plan_mail_activity_mail_activity_schedule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_mail_activity_schedule_rel
    ADD CONSTRAINT mail_activity_plan_mail_activity_mail_activity_schedule_id_fkey FOREIGN KEY (mail_activity_schedule_id) REFERENCES public.mail_activity_schedule(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_mail_activity_schedule_rel mail_activity_plan_mail_activity_sch_mail_activity_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_mail_activity_schedule_rel
    ADD CONSTRAINT mail_activity_plan_mail_activity_sch_mail_activity_plan_id_fkey FOREIGN KEY (mail_activity_plan_id) REFERENCES public.mail_activity_plan(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan mail_activity_plan_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan
    ADD CONSTRAINT mail_activity_plan_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_template mail_activity_plan_template_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template
    ADD CONSTRAINT mail_activity_plan_template_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: mail_activity_plan_template mail_activity_plan_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template
    ADD CONSTRAINT mail_activity_plan_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan_template_mail_activity_type_rel mail_activity_plan_template_m_mail_activity_plan_template__fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template_mail_activity_type_rel
    ADD CONSTRAINT mail_activity_plan_template_m_mail_activity_plan_template__fkey FOREIGN KEY (mail_activity_plan_template_id) REFERENCES public.mail_activity_plan_template(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_template_mail_activity_type_rel mail_activity_plan_template_mail_act_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template_mail_activity_type_rel
    ADD CONSTRAINT mail_activity_plan_template_mail_act_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_template mail_activity_plan_template_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template
    ADD CONSTRAINT mail_activity_plan_template_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.mail_activity_plan(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_template mail_activity_plan_template_responsible_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template
    ADD CONSTRAINT mail_activity_plan_template_responsible_id_fkey FOREIGN KEY (responsible_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan_template mail_activity_plan_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan_template
    ADD CONSTRAINT mail_activity_plan_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_plan mail_activity_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_plan
    ADD CONSTRAINT mail_activity_plan_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_previous_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_previous_activity_type_id_fkey FOREIGN KEY (previous_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_recommended_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_recommended_activity_type_id_fkey FOREIGN KEY (recommended_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_activity_rel mail_activity_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_rel
    ADD CONSTRAINT mail_activity_rel_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity_rel mail_activity_rel_recommended_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_rel
    ADD CONSTRAINT mail_activity_rel_recommended_id_fkey FOREIGN KEY (recommended_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_activity_schedule mail_activity_schedule_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule mail_activity_schedule_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_activity_user_id_fkey FOREIGN KEY (activity_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule mail_activity_schedule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule_line mail_activity_schedule_line_activity_schedule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule_line
    ADD CONSTRAINT mail_activity_schedule_line_activity_schedule_id_fkey FOREIGN KEY (activity_schedule_id) REFERENCES public.mail_activity_schedule(id) ON DELETE CASCADE;


--
-- Name: mail_activity_schedule_line mail_activity_schedule_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule_line
    ADD CONSTRAINT mail_activity_schedule_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule_line mail_activity_schedule_line_responsible_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule_line
    ADD CONSTRAINT mail_activity_schedule_line_responsible_user_id_fkey FOREIGN KEY (responsible_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule_line mail_activity_schedule_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule_line
    ADD CONSTRAINT mail_activity_schedule_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule mail_activity_schedule_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.mail_activity_plan(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule mail_activity_schedule_plan_on_demand_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_plan_on_demand_user_id_fkey FOREIGN KEY (plan_on_demand_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_schedule mail_activity_schedule_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_activity_schedule mail_activity_schedule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_schedule
    ADD CONSTRAINT mail_activity_schedule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_type mail_activity_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_type mail_activity_type_default_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_default_user_id_fkey FOREIGN KEY (default_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity_type_mail_template_rel mail_activity_type_mail_template_rel_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type_mail_template_rel
    ADD CONSTRAINT mail_activity_type_mail_template_rel_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE CASCADE;


--
-- Name: mail_activity_type_mail_template_rel mail_activity_type_mail_template_rel_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type_mail_template_rel
    ADD CONSTRAINT mail_activity_type_mail_template_rel_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_activity_type mail_activity_type_triggered_next_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_triggered_next_type_id_fkey FOREIGN KEY (triggered_next_type_id) REFERENCES public.mail_activity_type(id) ON DELETE RESTRICT;


--
-- Name: mail_activity_type mail_activity_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity_type
    ADD CONSTRAINT mail_activity_type_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_alias_domain_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_domain_id_fkey FOREIGN KEY (alias_domain_id) REFERENCES public.mail_alias_domain(id) ON DELETE RESTRICT;


--
-- Name: mail_alias mail_alias_alias_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_model_id_fkey FOREIGN KEY (alias_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_alias mail_alias_alias_parent_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_alias_parent_model_id_fkey FOREIGN KEY (alias_parent_model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias_domain mail_alias_domain_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias_domain
    ADD CONSTRAINT mail_alias_domain_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias_domain mail_alias_domain_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias_domain
    ADD CONSTRAINT mail_alias_domain_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_alias mail_alias_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_alias
    ADD CONSTRAINT mail_alias_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist mail_blacklist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_blacklist
    ADD CONSTRAINT mail_blacklist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist_remove mail_blacklist_remove_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_blacklist_remove
    ADD CONSTRAINT mail_blacklist_remove_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist_remove mail_blacklist_remove_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_blacklist_remove
    ADD CONSTRAINT mail_blacklist_remove_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_blacklist mail_blacklist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_blacklist
    ADD CONSTRAINT mail_blacklist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_canned_response mail_canned_response_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_canned_response
    ADD CONSTRAINT mail_canned_response_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_canned_response_res_groups_rel mail_canned_response_res_groups_re_mail_canned_response_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_canned_response_res_groups_rel
    ADD CONSTRAINT mail_canned_response_res_groups_re_mail_canned_response_id_fkey FOREIGN KEY (mail_canned_response_id) REFERENCES public.mail_canned_response(id) ON DELETE CASCADE;


--
-- Name: mail_canned_response_res_groups_rel mail_canned_response_res_groups_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_canned_response_res_groups_rel
    ADD CONSTRAINT mail_canned_response_res_groups_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: mail_canned_response mail_canned_response_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_canned_response
    ADD CONSTRAINT mail_canned_response_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message_ir_attachments_rel mail_compose_message_ir_attachments_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT mail_compose_message_ir_attachments_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message_ir_attachments_rel mail_compose_message_ir_attachments_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message_ir_attachments_rel
    ADD CONSTRAINT mail_compose_message_ir_attachments_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_record_alias_domain_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_record_alias_domain_id_fkey FOREIGN KEY (record_alias_domain_id) REFERENCES public.mail_alias_domain(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_record_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_record_company_id_fkey FOREIGN KEY (record_company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_res_domain_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_res_domain_user_id_fkey FOREIGN KEY (res_domain_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message_res_partner_rel mail_compose_message_res_partner_rel_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message_res_partner_rel
    ADD CONSTRAINT mail_compose_message_res_partner_rel_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message_res_partner_rel mail_compose_message_res_partner_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message_res_partner_rel
    ADD CONSTRAINT mail_compose_message_res_partner_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: mail_compose_message mail_compose_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_subtype_id_fkey FOREIGN KEY (subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: mail_compose_message mail_compose_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_compose_message
    ADD CONSTRAINT mail_compose_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_followers_edit mail_followers_edit_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_edit
    ADD CONSTRAINT mail_followers_edit_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_followers_edit_res_partner_rel mail_followers_edit_res_partner_rel_mail_followers_edit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_edit_res_partner_rel
    ADD CONSTRAINT mail_followers_edit_res_partner_rel_mail_followers_edit_id_fkey FOREIGN KEY (mail_followers_edit_id) REFERENCES public.mail_followers_edit(id) ON DELETE CASCADE;


--
-- Name: mail_followers_edit_res_partner_rel mail_followers_edit_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_edit_res_partner_rel
    ADD CONSTRAINT mail_followers_edit_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_followers_edit mail_followers_edit_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_edit
    ADD CONSTRAINT mail_followers_edit_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_followers_mail_message_subtype_rel mail_followers_mail_message_subtyp_mail_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_mail_message_subtype_rel
    ADD CONSTRAINT mail_followers_mail_message_subtyp_mail_message_subtype_id_fkey FOREIGN KEY (mail_message_subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE CASCADE;


--
-- Name: mail_followers_mail_message_subtype_rel mail_followers_mail_message_subtype_rel_mail_followers_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers_mail_message_subtype_rel
    ADD CONSTRAINT mail_followers_mail_message_subtype_rel_mail_followers_id_fkey FOREIGN KEY (mail_followers_id) REFERENCES public.mail_followers(id) ON DELETE CASCADE;


--
-- Name: mail_followers mail_followers_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_followers
    ADD CONSTRAINT mail_followers_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_gateway_allowed mail_gateway_allowed_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_gateway_allowed
    ADD CONSTRAINT mail_gateway_allowed_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_gateway_allowed mail_gateway_allowed_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_gateway_allowed
    ADD CONSTRAINT mail_gateway_allowed_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_guest mail_guest_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_guest
    ADD CONSTRAINT mail_guest_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_ice_server mail_ice_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_ice_server
    ADD CONSTRAINT mail_ice_server_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_ice_server mail_ice_server_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_ice_server
    ADD CONSTRAINT mail_ice_server_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_link_preview mail_link_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_link_preview mail_link_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_fetchmail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_fetchmail_server_id_fkey FOREIGN KEY (fetchmail_server_id) REFERENCES public.fetchmail_server(id) ON DELETE SET NULL;


--
-- Name: mail_mail mail_mail_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_mail_res_partner_rel mail_mail_res_partner_rel_mail_mail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail_res_partner_rel
    ADD CONSTRAINT mail_mail_res_partner_rel_mail_mail_id_fkey FOREIGN KEY (mail_mail_id) REFERENCES public.mail_mail(id) ON DELETE CASCADE;


--
-- Name: mail_mail_res_partner_rel mail_mail_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail_res_partner_rel
    ADD CONSTRAINT mail_mail_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_mail mail_mail_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_mail
    ADD CONSTRAINT mail_mail_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_author_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_author_guest_id_fkey FOREIGN KEY (author_guest_id) REFERENCES public.mail_guest(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_link_preview mail_message_link_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_link_preview
    ADD CONSTRAINT mail_message_link_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_link_preview mail_message_link_preview_link_preview_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_link_preview
    ADD CONSTRAINT mail_message_link_preview_link_preview_id_fkey FOREIGN KEY (link_preview_id) REFERENCES public.mail_link_preview(id) ON DELETE CASCADE;


--
-- Name: mail_message_link_preview mail_message_link_preview_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_link_preview
    ADD CONSTRAINT mail_message_link_preview_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_link_preview mail_message_link_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_link_preview
    ADD CONSTRAINT mail_message_link_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_mail_activity_type_id_fkey FOREIGN KEY (mail_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_message_reaction mail_message_reaction_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: mail_message_reaction mail_message_reaction_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_reaction mail_message_reaction_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_reaction
    ADD CONSTRAINT mail_message_reaction_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message mail_message_record_alias_domain_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_record_alias_domain_id_fkey FOREIGN KEY (record_alias_domain_id) REFERENCES public.mail_alias_domain(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_record_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_record_company_id_fkey FOREIGN KEY (record_company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: mail_message_res_partner_rel mail_message_res_partner_rel_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_res_partner_rel
    ADD CONSTRAINT mail_message_res_partner_rel_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_rel mail_message_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_res_partner_rel
    ADD CONSTRAINT mail_message_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_starred_rel mail_message_res_partner_starred_rel_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_res_partner_starred_rel
    ADD CONSTRAINT mail_message_res_partner_starred_rel_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_res_partner_starred_rel mail_message_res_partner_starred_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_res_partner_starred_rel
    ADD CONSTRAINT mail_message_res_partner_starred_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_message_schedule mail_message_schedule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_schedule mail_message_schedule_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_schedule mail_message_schedule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_schedule
    ADD CONSTRAINT mail_message_schedule_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_subtype_id_fkey FOREIGN KEY (subtype_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.mail_message_subtype(id) ON DELETE SET NULL;


--
-- Name: mail_message_subtype mail_message_subtype_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_subtype
    ADD CONSTRAINT mail_message_subtype_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_translation mail_message_translation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_translation
    ADD CONSTRAINT mail_message_translation_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message_translation mail_message_translation_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_translation
    ADD CONSTRAINT mail_message_translation_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_message_translation mail_message_translation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message_translation
    ADD CONSTRAINT mail_message_translation_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_message mail_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_message
    ADD CONSTRAINT mail_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_letter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_letter_id_fkey FOREIGN KEY (letter_id) REFERENCES public.snailmail_letter(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_mail_mail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_mail_mail_id_fkey FOREIGN KEY (mail_mail_id) REFERENCES public.mail_mail(id) ON DELETE SET NULL;


--
-- Name: mail_notification mail_notification_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_notification
    ADD CONSTRAINT mail_notification_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_presence mail_presence_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_presence
    ADD CONSTRAINT mail_presence_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: mail_presence mail_presence_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_presence
    ADD CONSTRAINT mail_presence_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: mail_push mail_push_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push
    ADD CONSTRAINT mail_push_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_push_device mail_push_device_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push_device
    ADD CONSTRAINT mail_push_device_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_push_device mail_push_device_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push_device
    ADD CONSTRAINT mail_push_device_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: mail_push_device mail_push_device_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push_device
    ADD CONSTRAINT mail_push_device_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_push mail_push_mail_push_device_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push
    ADD CONSTRAINT mail_push_mail_push_device_id_fkey FOREIGN KEY (mail_push_device_id) REFERENCES public.mail_push_device(id) ON DELETE CASCADE;


--
-- Name: mail_push mail_push_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_push
    ADD CONSTRAINT mail_push_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_scheduled_message mail_scheduled_message_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_scheduled_message
    ADD CONSTRAINT mail_scheduled_message_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: mail_scheduled_message mail_scheduled_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_scheduled_message
    ADD CONSTRAINT mail_scheduled_message_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_scheduled_message_res_partner_rel mail_scheduled_message_res_partn_mail_scheduled_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_scheduled_message_res_partner_rel
    ADD CONSTRAINT mail_scheduled_message_res_partn_mail_scheduled_message_id_fkey FOREIGN KEY (mail_scheduled_message_id) REFERENCES public.mail_scheduled_message(id) ON DELETE CASCADE;


--
-- Name: mail_scheduled_message_res_partner_rel mail_scheduled_message_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_scheduled_message_res_partner_rel
    ADD CONSTRAINT mail_scheduled_message_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: mail_scheduled_message mail_scheduled_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_scheduled_message
    ADD CONSTRAINT mail_scheduled_message_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template_ir_actions_report_rel mail_template_ir_actions_report_rel_ir_actions_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_ir_actions_report_rel
    ADD CONSTRAINT mail_template_ir_actions_report_rel_ir_actions_report_id_fkey FOREIGN KEY (ir_actions_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE CASCADE;


--
-- Name: mail_template_ir_actions_report_rel mail_template_ir_actions_report_rel_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_ir_actions_report_rel
    ADD CONSTRAINT mail_template_ir_actions_report_rel_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_template mail_template_mail_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_mail_server_id_fkey FOREIGN KEY (mail_server_id) REFERENCES public.ir_mail_server(id) ON DELETE SET NULL;


--
-- Name: mail_template_mail_template_reset_rel mail_template_mail_template_reset_r_mail_template_reset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_mail_template_reset_rel
    ADD CONSTRAINT mail_template_mail_template_reset_r_mail_template_reset_id_fkey FOREIGN KEY (mail_template_reset_id) REFERENCES public.mail_template_reset(id) ON DELETE CASCADE;


--
-- Name: mail_template_mail_template_reset_rel mail_template_mail_template_reset_rel_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_mail_template_reset_rel
    ADD CONSTRAINT mail_template_mail_template_reset_rel_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_template mail_template_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: mail_template_preview mail_template_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template_preview mail_template_preview_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE CASCADE;


--
-- Name: mail_template_preview mail_template_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_preview
    ADD CONSTRAINT mail_template_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_ref_ir_act_window_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_ref_ir_act_window_fkey FOREIGN KEY (ref_ir_act_window) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: mail_template_reset mail_template_reset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_reset
    ADD CONSTRAINT mail_template_reset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template_reset mail_template_reset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template_reset
    ADD CONSTRAINT mail_template_reset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_template mail_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_template
    ADD CONSTRAINT mail_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: mail_tracking_value mail_tracking_value_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_tracking_value mail_tracking_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.mail_tracking_value
    ADD CONSTRAINT mail_tracking_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: message_attachment_rel message_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.message_attachment_rel
    ADD CONSTRAINT message_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: message_attachment_rel message_attachment_rel_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.message_attachment_rel
    ADD CONSTRAINT message_attachment_rel_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: module_country module_country_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.module_country
    ADD CONSTRAINT module_country_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: module_country module_country_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.module_country
    ADD CONSTRAINT module_country_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: onboarding_onboarding onboarding_onboarding_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding
    ADD CONSTRAINT onboarding_onboarding_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_onboarding_onboarding_onboarding_step_rel onboarding_onboarding_onboard_onboarding_onboarding_step_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding_onboarding_onboarding_step_rel
    ADD CONSTRAINT onboarding_onboarding_onboard_onboarding_onboarding_step_i_fkey FOREIGN KEY (onboarding_onboarding_step_id) REFERENCES public.onboarding_onboarding_step(id) ON DELETE CASCADE;


--
-- Name: onboarding_onboarding_onboarding_onboarding_step_rel onboarding_onboarding_onboarding__onboarding_onboarding_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding_onboarding_onboarding_step_rel
    ADD CONSTRAINT onboarding_onboarding_onboarding__onboarding_onboarding_id_fkey FOREIGN KEY (onboarding_onboarding_id) REFERENCES public.onboarding_onboarding(id) ON DELETE CASCADE;


--
-- Name: onboarding_onboarding_step onboarding_onboarding_step_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding_step
    ADD CONSTRAINT onboarding_onboarding_step_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_onboarding_step onboarding_onboarding_step_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding_step
    ADD CONSTRAINT onboarding_onboarding_step_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_onboarding onboarding_onboarding_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_onboarding
    ADD CONSTRAINT onboarding_onboarding_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_progress onboarding_progress_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress
    ADD CONSTRAINT onboarding_progress_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress onboarding_progress_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress
    ADD CONSTRAINT onboarding_progress_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_progress onboarding_progress_onboarding_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress
    ADD CONSTRAINT onboarding_progress_onboarding_id_fkey FOREIGN KEY (onboarding_id) REFERENCES public.onboarding_onboarding(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress_onboarding_progress_step_rel onboarding_progress_onboarding_onboarding_progress_step_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_onboarding_progress_step_rel
    ADD CONSTRAINT onboarding_progress_onboarding_onboarding_progress_step_id_fkey FOREIGN KEY (onboarding_progress_step_id) REFERENCES public.onboarding_progress_step(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress_onboarding_progress_step_rel onboarding_progress_onboarding_prog_onboarding_progress_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_onboarding_progress_step_rel
    ADD CONSTRAINT onboarding_progress_onboarding_prog_onboarding_progress_id_fkey FOREIGN KEY (onboarding_progress_id) REFERENCES public.onboarding_progress(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress_step onboarding_progress_step_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_step
    ADD CONSTRAINT onboarding_progress_step_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress_step onboarding_progress_step_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_step
    ADD CONSTRAINT onboarding_progress_step_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_progress_step onboarding_progress_step_step_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_step
    ADD CONSTRAINT onboarding_progress_step_step_id_fkey FOREIGN KEY (step_id) REFERENCES public.onboarding_onboarding_step(id) ON DELETE CASCADE;


--
-- Name: onboarding_progress_step onboarding_progress_step_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress_step
    ADD CONSTRAINT onboarding_progress_step_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: onboarding_progress onboarding_progress_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.onboarding_progress
    ADD CONSTRAINT onboarding_progress_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_capture_wizard payment_capture_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_capture_wizard
    ADD CONSTRAINT payment_capture_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_capture_wizard_payment_transaction_rel payment_capture_wizard_payment_t_payment_capture_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_capture_wizard_payment_transaction_rel
    ADD CONSTRAINT payment_capture_wizard_payment_t_payment_capture_wizard_id_fkey FOREIGN KEY (payment_capture_wizard_id) REFERENCES public.payment_capture_wizard(id) ON DELETE CASCADE;


--
-- Name: payment_capture_wizard_payment_transaction_rel payment_capture_wizard_payment_tran_payment_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_capture_wizard_payment_transaction_rel
    ADD CONSTRAINT payment_capture_wizard_payment_tran_payment_transaction_id_fkey FOREIGN KEY (payment_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: payment_capture_wizard payment_capture_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_capture_wizard
    ADD CONSTRAINT payment_capture_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_country_rel payment_country_rel_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_country_rel
    ADD CONSTRAINT payment_country_rel_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: payment_country_rel payment_country_rel_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_country_rel
    ADD CONSTRAINT payment_country_rel_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.payment_provider(id) ON DELETE CASCADE;


--
-- Name: payment_currency_rel payment_currency_rel_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_currency_rel
    ADD CONSTRAINT payment_currency_rel_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: payment_currency_rel payment_currency_rel_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_currency_rel
    ADD CONSTRAINT payment_currency_rel_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE CASCADE;


--
-- Name: payment_link_wizard payment_link_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: payment_link_wizard payment_link_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_link_wizard
    ADD CONSTRAINT payment_link_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_method payment_method_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method
    ADD CONSTRAINT payment_method_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_method_payment_provider_rel payment_method_payment_provider_rel_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_payment_provider_rel
    ADD CONSTRAINT payment_method_payment_provider_rel_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.payment_method(id) ON DELETE CASCADE;


--
-- Name: payment_method_payment_provider_rel payment_method_payment_provider_rel_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_payment_provider_rel
    ADD CONSTRAINT payment_method_payment_provider_rel_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE CASCADE;


--
-- Name: payment_method payment_method_primary_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method
    ADD CONSTRAINT payment_method_primary_payment_method_id_fkey FOREIGN KEY (primary_payment_method_id) REFERENCES public.payment_method(id) ON DELETE SET NULL;


--
-- Name: payment_method_res_country_rel payment_method_res_country_rel_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_res_country_rel
    ADD CONSTRAINT payment_method_res_country_rel_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.payment_method(id) ON DELETE CASCADE;


--
-- Name: payment_method_res_country_rel payment_method_res_country_rel_res_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_res_country_rel
    ADD CONSTRAINT payment_method_res_country_rel_res_country_id_fkey FOREIGN KEY (res_country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: payment_method_res_currency_rel payment_method_res_currency_rel_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_res_currency_rel
    ADD CONSTRAINT payment_method_res_currency_rel_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.payment_method(id) ON DELETE CASCADE;


--
-- Name: payment_method_res_currency_rel payment_method_res_currency_rel_res_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method_res_currency_rel
    ADD CONSTRAINT payment_method_res_currency_rel_res_currency_id_fkey FOREIGN KEY (res_currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: payment_method payment_method_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_method
    ADD CONSTRAINT payment_method_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_express_checkout_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_express_checkout_form_view_id_fkey FOREIGN KEY (express_checkout_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_inline_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_inline_form_view_id_fkey FOREIGN KEY (inline_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE SET NULL;


--
-- Name: payment_provider_onboarding_wizard payment_provider_onboarding_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider_onboarding_wizard
    ADD CONSTRAINT payment_provider_onboarding_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider_onboarding_wizard payment_provider_onboarding_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider_onboarding_wizard
    ADD CONSTRAINT payment_provider_onboarding_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_provider payment_provider_redirect_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_redirect_form_view_id_fkey FOREIGN KEY (redirect_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_token_inline_form_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_token_inline_form_view_id_fkey FOREIGN KEY (token_inline_form_view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: payment_provider payment_provider_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_provider
    ADD CONSTRAINT payment_provider_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: payment_refund_wizard payment_refund_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_refund_wizard
    ADD CONSTRAINT payment_refund_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_token payment_token_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: payment_token payment_token_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.payment_method(id) ON DELETE RESTRICT;


--
-- Name: payment_token payment_token_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.payment_provider(id) ON DELETE RESTRICT;


--
-- Name: payment_token payment_token_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_token
    ADD CONSTRAINT payment_token_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_partner_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_country_id_fkey FOREIGN KEY (partner_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_partner_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_partner_state_id_fkey FOREIGN KEY (partner_state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.payment_method(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.payment_provider(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_source_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_source_transaction_id_fkey FOREIGN KEY (source_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: payment_transaction payment_transaction_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_token_id_fkey FOREIGN KEY (token_id) REFERENCES public.payment_token(id) ON DELETE RESTRICT;


--
-- Name: payment_transaction payment_transaction_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.payment_transaction
    ADD CONSTRAINT payment_transaction_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist phone_blacklist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.phone_blacklist
    ADD CONSTRAINT phone_blacklist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist_remove phone_blacklist_remove_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.phone_blacklist_remove
    ADD CONSTRAINT phone_blacklist_remove_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist_remove phone_blacklist_remove_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.phone_blacklist_remove
    ADD CONSTRAINT phone_blacklist_remove_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: phone_blacklist phone_blacklist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.phone_blacklist
    ADD CONSTRAINT phone_blacklist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_share portal_share_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_share
    ADD CONSTRAINT portal_share_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_share_res_partner_rel portal_share_res_partner_rel_portal_share_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_share_res_partner_rel
    ADD CONSTRAINT portal_share_res_partner_rel_portal_share_id_fkey FOREIGN KEY (portal_share_id) REFERENCES public.portal_share(id) ON DELETE CASCADE;


--
-- Name: portal_share_res_partner_rel portal_share_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_share_res_partner_rel
    ADD CONSTRAINT portal_share_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_share portal_share_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_share
    ADD CONSTRAINT portal_share_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard portal_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard
    ADD CONSTRAINT portal_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard_res_partner_rel portal_wizard_res_partner_rel_portal_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_res_partner_rel
    ADD CONSTRAINT portal_wizard_res_partner_rel_portal_wizard_id_fkey FOREIGN KEY (portal_wizard_id) REFERENCES public.portal_wizard(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_res_partner_rel portal_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_res_partner_rel
    ADD CONSTRAINT portal_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard_user portal_wizard_user_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.portal_wizard(id) ON DELETE CASCADE;


--
-- Name: portal_wizard_user portal_wizard_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard_user
    ADD CONSTRAINT portal_wizard_user_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: portal_wizard portal_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.portal_wizard
    ADD CONSTRAINT portal_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_log privacy_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_log privacy_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: privacy_log privacy_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_log
    ADD CONSTRAINT privacy_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.privacy_lookup_wizard(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard_line privacy_lookup_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard_line
    ADD CONSTRAINT privacy_lookup_wizard_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_log_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_log_id_fkey FOREIGN KEY (log_id) REFERENCES public.privacy_log(id) ON DELETE SET NULL;


--
-- Name: privacy_lookup_wizard privacy_lookup_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.privacy_lookup_wizard
    ADD CONSTRAINT privacy_lookup_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_accessory_rel product_accessory_rel_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_accessory_rel
    ADD CONSTRAINT product_accessory_rel_dest_id_fkey FOREIGN KEY (dest_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_accessory_rel product_accessory_rel_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_accessory_rel
    ADD CONSTRAINT product_accessory_rel_src_id_fkey FOREIGN KEY (src_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_alternative_rel product_alternative_rel_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_alternative_rel
    ADD CONSTRAINT product_alternative_rel_dest_id_fkey FOREIGN KEY (dest_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_alternative_rel product_alternative_rel_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_alternative_rel
    ADD CONSTRAINT product_alternative_rel_src_id_fkey FOREIGN KEY (src_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_attr_exclusion_value_ids_rel product_attr_exclusion_value__product_template_attribute_e_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attr_exclusion_value_ids_rel
    ADD CONSTRAINT product_attr_exclusion_value__product_template_attribute_e_fkey FOREIGN KEY (product_template_attribute_exclusion_id) REFERENCES public.product_template_attribute_exclusion(id) ON DELETE CASCADE;


--
-- Name: product_attr_exclusion_value_ids_rel product_attr_exclusion_value__product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attr_exclusion_value_ids_rel
    ADD CONSTRAINT product_attr_exclusion_value__product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_attribute product_attribute_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute
    ADD CONSTRAINT product_attribute_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_custom_value product_attribute_custom_valu_custom_product_template_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_valu_custom_product_template_attr_fkey FOREIGN KEY (custom_product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: product_attribute_custom_value product_attribute_custom_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_custom_value
    ADD CONSTRAINT product_attribute_custom_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_product_template_rel product_attribute_product_template_re_product_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_product_template_rel
    ADD CONSTRAINT product_attribute_product_template_re_product_attribute_id_fkey FOREIGN KEY (product_attribute_id) REFERENCES public.product_attribute(id) ON DELETE CASCADE;


--
-- Name: product_attribute_product_template_rel product_attribute_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_product_template_rel
    ADD CONSTRAINT product_attribute_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value product_attribute_value_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value product_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute_value_product_template_attribute_line_rel product_attribute_value_produ_product_template_attribute_l_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_value_product_template_attribute_line_rel
    ADD CONSTRAINT product_attribute_value_produ_product_template_attribute_l_fkey FOREIGN KEY (product_template_attribute_line_id) REFERENCES public.product_template_attribute_line(id) ON DELETE CASCADE;


--
-- Name: product_attribute_value_product_template_attribute_line_rel product_attribute_value_product_product_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_value_product_template_attribute_line_rel
    ADD CONSTRAINT product_attribute_value_product_product_attribute_value_id_fkey FOREIGN KEY (product_attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_attribute_value product_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute_value
    ADD CONSTRAINT product_attribute_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_attribute product_attribute_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_attribute
    ADD CONSTRAINT product_attribute_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_category product_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_category product_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: product_category product_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_category
    ADD CONSTRAINT product_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_combo product_combo_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo
    ADD CONSTRAINT product_combo_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_combo product_combo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo
    ADD CONSTRAINT product_combo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_combo_item product_combo_item_combo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_item
    ADD CONSTRAINT product_combo_item_combo_id_fkey FOREIGN KEY (combo_id) REFERENCES public.product_combo(id) ON DELETE CASCADE;


--
-- Name: product_combo_item product_combo_item_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_item
    ADD CONSTRAINT product_combo_item_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_combo_item product_combo_item_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_item
    ADD CONSTRAINT product_combo_item_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_combo_item product_combo_item_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_item
    ADD CONSTRAINT product_combo_item_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: product_combo_item product_combo_item_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_item
    ADD CONSTRAINT product_combo_item_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_combo_product_template_rel product_combo_product_template_rel_product_combo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_product_template_rel
    ADD CONSTRAINT product_combo_product_template_rel_product_combo_id_fkey FOREIGN KEY (product_combo_id) REFERENCES public.product_combo(id) ON DELETE CASCADE;


--
-- Name: product_combo_product_template_rel product_combo_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo_product_template_rel
    ADD CONSTRAINT product_combo_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_combo product_combo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_combo
    ADD CONSTRAINT product_combo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_document product_document_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_document
    ADD CONSTRAINT product_document_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_document product_document_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_document
    ADD CONSTRAINT product_document_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: product_document_sale_pdf_form_field_rel product_document_sale_pdf_form_fiel_sale_pdf_form_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_document_sale_pdf_form_field_rel
    ADD CONSTRAINT product_document_sale_pdf_form_fiel_sale_pdf_form_field_id_fkey FOREIGN KEY (sale_pdf_form_field_id) REFERENCES public.sale_pdf_form_field(id) ON DELETE CASCADE;


--
-- Name: product_document_sale_pdf_form_field_rel product_document_sale_pdf_form_field_r_product_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_document_sale_pdf_form_field_rel
    ADD CONSTRAINT product_document_sale_pdf_form_field_r_product_document_id_fkey FOREIGN KEY (product_document_id) REFERENCES public.product_document(id) ON DELETE CASCADE;


--
-- Name: product_document product_document_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_document
    ADD CONSTRAINT product_document_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_fetch_image_wizard product_fetch_image_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_fetch_image_wizard
    ADD CONSTRAINT product_fetch_image_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_fetch_image_wizard_product_product_rel product_fetch_image_wizard_pr_product_fetch_image_wizard_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_fetch_image_wizard_product_product_rel
    ADD CONSTRAINT product_fetch_image_wizard_pr_product_fetch_image_wizard_i_fkey FOREIGN KEY (product_fetch_image_wizard_id) REFERENCES public.product_fetch_image_wizard(id) ON DELETE CASCADE;


--
-- Name: product_fetch_image_wizard_product_product_rel product_fetch_image_wizard_product_prod_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_fetch_image_wizard_product_product_rel
    ADD CONSTRAINT product_fetch_image_wizard_product_prod_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_fetch_image_wizard product_fetch_image_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_fetch_image_wizard
    ADD CONSTRAINT product_fetch_image_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_image product_image_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_image
    ADD CONSTRAINT product_image_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_image product_image_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_image
    ADD CONSTRAINT product_image_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_image product_image_product_variant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_image
    ADD CONSTRAINT product_image_product_variant_id_fkey FOREIGN KEY (product_variant_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_image product_image_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_image
    ADD CONSTRAINT product_image_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_label_layout product_label_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout
    ADD CONSTRAINT product_label_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_label_layout product_label_layout_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout
    ADD CONSTRAINT product_label_layout_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE SET NULL;


--
-- Name: product_label_layout_product_product_rel product_label_layout_product_produ_product_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout_product_product_rel
    ADD CONSTRAINT product_label_layout_product_produ_product_label_layout_id_fkey FOREIGN KEY (product_label_layout_id) REFERENCES public.product_label_layout(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_product_rel product_label_layout_product_product_re_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout_product_product_rel
    ADD CONSTRAINT product_label_layout_product_product_re_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_template_rel product_label_layout_product_templ_product_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout_product_template_rel
    ADD CONSTRAINT product_label_layout_product_templ_product_label_layout_id_fkey FOREIGN KEY (product_label_layout_id) REFERENCES public.product_label_layout(id) ON DELETE CASCADE;


--
-- Name: product_label_layout_product_template_rel product_label_layout_product_template__product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout_product_template_rel
    ADD CONSTRAINT product_label_layout_product_template__product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_label_layout product_label_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_label_layout
    ADD CONSTRAINT product_label_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_optional_rel product_optional_rel_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_optional_rel
    ADD CONSTRAINT product_optional_rel_dest_id_fkey FOREIGN KEY (dest_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_optional_rel product_optional_rel_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_optional_rel
    ADD CONSTRAINT product_optional_rel_src_id_fkey FOREIGN KEY (src_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_pricelist product_pricelist_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: product_pricelist_item product_pricelist_item_base_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_base_pricelist_id_fkey FOREIGN KEY (base_pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: product_pricelist_item product_pricelist_item_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_pricelist_item product_pricelist_item_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist_item
    ADD CONSTRAINT product_pricelist_item_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_pricelist product_pricelist_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: product_pricelist product_pricelist_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_pricelist
    ADD CONSTRAINT product_pricelist_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_base_unit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_base_unit_id_fkey FOREIGN KEY (base_unit_id) REFERENCES public.website_base_unit(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_product product_product_variant_ribbon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_variant_ribbon_id_fkey FOREIGN KEY (variant_ribbon_id) REFERENCES public.product_ribbon(id) ON DELETE SET NULL;


--
-- Name: product_product product_product_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_product
    ADD CONSTRAINT product_product_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_public_category product_public_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category
    ADD CONSTRAINT product_public_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_public_category product_public_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category
    ADD CONSTRAINT product_public_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.product_public_category(id) ON DELETE CASCADE;


--
-- Name: product_public_category_product_template_rel product_public_category_product_product_public_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category_product_template_rel
    ADD CONSTRAINT product_public_category_product_product_public_category_id_fkey FOREIGN KEY (product_public_category_id) REFERENCES public.product_public_category(id) ON DELETE CASCADE;


--
-- Name: product_public_category_product_template_rel product_public_category_product_templa_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category_product_template_rel
    ADD CONSTRAINT product_public_category_product_templa_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_public_category product_public_category_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category
    ADD CONSTRAINT product_public_category_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: product_public_category product_public_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_public_category
    ADD CONSTRAINT product_public_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_ribbon product_ribbon_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_ribbon
    ADD CONSTRAINT product_ribbon_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_ribbon product_ribbon_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_ribbon
    ADD CONSTRAINT product_ribbon_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: product_supplierinfo product_supplierinfo_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_supplierinfo product_supplierinfo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_tag product_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag
    ADD CONSTRAINT product_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_tag_delivery_carrier_excluded_rel product_tag_delivery_carrier_excluded__delivery_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_delivery_carrier_excluded_rel
    ADD CONSTRAINT product_tag_delivery_carrier_excluded__delivery_carrier_id_fkey FOREIGN KEY (delivery_carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: product_tag_delivery_carrier_excluded_rel product_tag_delivery_carrier_excluded_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_delivery_carrier_excluded_rel
    ADD CONSTRAINT product_tag_delivery_carrier_excluded_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_delivery_carrier_must_have_rel product_tag_delivery_carrier_must_have_delivery_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_delivery_carrier_must_have_rel
    ADD CONSTRAINT product_tag_delivery_carrier_must_have_delivery_carrier_id_fkey FOREIGN KEY (delivery_carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE CASCADE;


--
-- Name: product_tag_delivery_carrier_must_have_rel product_tag_delivery_carrier_must_have_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_delivery_carrier_must_have_rel
    ADD CONSTRAINT product_tag_delivery_carrier_must_have_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_tag product_tag_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag
    ADD CONSTRAINT product_tag_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: product_tag product_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_tag
    ADD CONSTRAINT product_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_taxes_rel product_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_taxes_rel product_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_ex_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_ex_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_line product_template_attribute_line_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_line product_template_attribute_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_line product_template_attribute_line_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_line product_template_attribute_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_va_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_va_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_value product_template_attribute_valu_product_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_valu_product_attribute_value_id_fkey FOREIGN KEY (product_attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_line_id_fkey FOREIGN KEY (attribute_line_id) REFERENCES public.product_template_attribute_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value product_template_attribute_value_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_value_sale_o_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_value_sale_o_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_base_unit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_base_unit_id_fkey FOREIGN KEY (base_unit_id) REFERENCES public.website_base_unit(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_template_uom_uom_rel product_template_uom_uom_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_uom_uom_rel
    ADD CONSTRAINT product_template_uom_uom_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_uom_uom_rel product_template_uom_uom_rel_uom_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template_uom_uom_rel
    ADD CONSTRAINT product_template_uom_uom_rel_uom_uom_id_fkey FOREIGN KEY (uom_uom_id) REFERENCES public.uom_uom(id) ON DELETE CASCADE;


--
-- Name: product_template product_template_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_website_ribbon_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_website_ribbon_id_fkey FOREIGN KEY (website_ribbon_id) REFERENCES public.product_ribbon(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_uom product_uom_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_uom
    ADD CONSTRAINT product_uom_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_uom product_uom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_uom
    ADD CONSTRAINT product_uom_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_uom product_uom_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_uom
    ADD CONSTRAINT product_uom_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_uom product_uom_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_uom
    ADD CONSTRAINT product_uom_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE CASCADE;


--
-- Name: product_uom product_uom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_uom
    ADD CONSTRAINT product_uom_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: product_variant_combination product_variant_combination_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_variant_combination product_variant_combination_product_template_attribute_val_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_template_attribute_val_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: qr_code_payment_wizard qr_code_payment_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.qr_code_payment_wizard
    ADD CONSTRAINT qr_code_payment_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: qr_code_payment_wizard qr_code_payment_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.qr_code_payment_wizard
    ADD CONSTRAINT qr_code_payment_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: qr_code_payment_wizard qr_code_payment_wizard_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.qr_code_payment_wizard
    ADD CONSTRAINT qr_code_payment_wizard_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: qr_code_payment_wizard qr_code_payment_wizard_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.qr_code_payment_wizard
    ADD CONSTRAINT qr_code_payment_wizard_return_id_fkey FOREIGN KEY (return_id) REFERENCES public.account_return(id) ON DELETE CASCADE;


--
-- Name: qr_code_payment_wizard qr_code_payment_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.qr_code_payment_wizard
    ADD CONSTRAINT qr_code_payment_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: quotation_document quotation_document_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document
    ADD CONSTRAINT quotation_document_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: quotation_document quotation_document_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document
    ADD CONSTRAINT quotation_document_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_order_rel quotation_document_sale_order_rel_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document_sale_order_rel
    ADD CONSTRAINT quotation_document_sale_order_rel_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_order_rel quotation_document_sale_order_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document_sale_order_rel
    ADD CONSTRAINT quotation_document_sale_order_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_pdf_form_field_rel quotation_document_sale_pdf_form_fi_sale_pdf_form_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document_sale_pdf_form_field_rel
    ADD CONSTRAINT quotation_document_sale_pdf_form_fi_sale_pdf_form_field_id_fkey FOREIGN KEY (sale_pdf_form_field_id) REFERENCES public.sale_pdf_form_field(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_pdf_form_field_rel quotation_document_sale_pdf_form_fie_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document_sale_pdf_form_field_rel
    ADD CONSTRAINT quotation_document_sale_pdf_form_fie_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


--
-- Name: quotation_document quotation_document_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.quotation_document
    ADD CONSTRAINT quotation_document_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_parent_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_parent_res_model_id_fkey FOREIGN KEY (parent_res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_publisher_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_publisher_id_fkey FOREIGN KEY (publisher_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_rated_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_rated_partner_id_fkey FOREIGN KEY (rated_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: registration_editor registration_editor_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor
    ADD CONSTRAINT registration_editor_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_editor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_editor_id_fkey FOREIGN KEY (editor_id) REFERENCES public.registration_editor(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: registration_editor_line registration_editor_line_event_slot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_event_slot_id_fkey FOREIGN KEY (event_slot_id) REFERENCES public.event_slot(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_event_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_event_ticket_id_fkey FOREIGN KEY (event_ticket_id) REFERENCES public.event_event_ticket(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_registration_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_registration_id_fkey FOREIGN KEY (registration_id) REFERENCES public.event_registration(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: registration_editor_line registration_editor_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor_line
    ADD CONSTRAINT registration_editor_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: registration_editor registration_editor_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor
    ADD CONSTRAINT registration_editor_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: registration_editor registration_editor_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.registration_editor
    ADD CONSTRAINT registration_editor_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rel_followup_manual_reminder_res_partner rel_followup_manual_reminder__account_followup_manual_remi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rel_followup_manual_reminder_res_partner
    ADD CONSTRAINT rel_followup_manual_reminder__account_followup_manual_remi_fkey FOREIGN KEY (account_followup_manual_reminder_id) REFERENCES public.account_followup_manual_reminder(id) ON DELETE CASCADE;


--
-- Name: rel_followup_manual_reminder_res_partner rel_followup_manual_reminder_res_partner_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rel_followup_manual_reminder_res_partner
    ADD CONSTRAINT rel_followup_manual_reminder_res_partner_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_wiz_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_wiz_id_fkey FOREIGN KEY (wiz_id) REFERENCES public.base_language_export(id) ON DELETE CASCADE;


--
-- Name: report_layout report_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_layout report_layout_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: report_layout report_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_paperformat report_paperformat_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.report_paperformat
    ADD CONSTRAINT report_paperformat_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: report_paperformat report_paperformat_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.report_paperformat
    ADD CONSTRAINT report_paperformat_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_country_fkey FOREIGN KEY (country) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_state_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_state_fkey FOREIGN KEY (state) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_cash_basis_base_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_cash_basis_base_account_id_fkey FOREIGN KEY (account_cash_basis_base_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_default_pos_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_default_pos_receivable_account_id_fkey FOREIGN KEY (account_default_pos_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_discount_expense_allocation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_discount_expense_allocation_id_fkey FOREIGN KEY (account_discount_expense_allocation_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_discount_income_allocation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_discount_income_allocation_id_fkey FOREIGN KEY (account_discount_income_allocation_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_fiscal_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_fiscal_country_id_fkey FOREIGN KEY (account_fiscal_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_gain_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_gain_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_gain_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_loss_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_loss_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_suspense_account_id_fkey FOREIGN KEY (account_journal_suspense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_opening_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_opening_move_id_fkey FOREIGN KEY (account_opening_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_purchase_receipt_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_purchase_receipt_tax_id_fkey FOREIGN KEY (account_purchase_receipt_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_purchase_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_purchase_tax_id_fkey FOREIGN KEY (account_purchase_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_representative_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_representative_id_fkey FOREIGN KEY (account_representative_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_revaluation_expense_provision_account__fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_revaluation_expense_provision_account__fkey FOREIGN KEY (account_revaluation_expense_provision_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_revaluation_income_provision_account_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_revaluation_income_provision_account_i_fkey FOREIGN KEY (account_revaluation_income_provision_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_revaluation_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_revaluation_journal_id_fkey FOREIGN KEY (account_revaluation_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_sale_receipt_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_sale_receipt_tax_id_fkey FOREIGN KEY (account_sale_receipt_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_sale_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_sale_tax_id_fkey FOREIGN KEY (account_sale_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_tax_return_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_tax_return_journal_id_fkey FOREIGN KEY (account_tax_return_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_alias_domain_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_alias_domain_id_fkey FOREIGN KEY (alias_domain_id) REFERENCES public.mail_alias_domain(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_automatic_entry_default_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_automatic_entry_default_journal_id_fkey FOREIGN KEY (automatic_entry_default_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_batch_payment_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_batch_payment_sequence_id_fkey FOREIGN KEY (batch_payment_sequence_id) REFERENCES public.ir_sequence(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_currency_exchange_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_currency_exchange_journal_id_fkey FOREIGN KEY (currency_exchange_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_default_cash_difference_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_expense_account_id_fkey FOREIGN KEY (default_cash_difference_expense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_default_cash_difference_income_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_income_account_id_fkey FOREIGN KEY (default_cash_difference_income_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_deferred_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_deferred_expense_account_id_fkey FOREIGN KEY (deferred_expense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_deferred_expense_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_deferred_expense_journal_id_fkey FOREIGN KEY (deferred_expense_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_deferred_revenue_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_deferred_revenue_account_id_fkey FOREIGN KEY (deferred_revenue_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_deferred_revenue_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_deferred_revenue_journal_id_fkey FOREIGN KEY (deferred_revenue_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_domestic_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_domestic_fiscal_position_id_fkey FOREIGN KEY (domestic_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_downpayment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_downpayment_account_id_fkey FOREIGN KEY (downpayment_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_account_id_fkey FOREIGN KEY (expense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_accrual_account_id_fkey FOREIGN KEY (expense_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_currency_exchange_account_id_fkey FOREIGN KEY (expense_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_external_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_external_report_layout_id_fkey FOREIGN KEY (external_report_layout_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_income_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_income_account_id_fkey FOREIGN KEY (income_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_income_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_income_currency_exchange_account_id_fkey FOREIGN KEY (income_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_incoterm_id_fkey FOREIGN KEY (incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_nomenclature_id_fkey FOREIGN KEY (nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_paperformat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_paperformat_id_fkey FOREIGN KEY (paperformat_id) REFERENCES public.report_paperformat(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_revenue_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_revenue_accrual_account_id_fkey FOREIGN KEY (revenue_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_sale_discount_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_sale_discount_product_id_fkey FOREIGN KEY (sale_discount_product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_signing_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_signing_user_fkey FOREIGN KEY (signing_user) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_tax_cash_basis_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_tax_cash_basis_journal_id_fkey FOREIGN KEY (tax_cash_basis_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_transfer_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_transfer_account_id_fkey FOREIGN KEY (transfer_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company_users_rel res_company_users_rel_cid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_cid_fkey FOREIGN KEY (cid) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_company_users_rel res_company_users_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_company res_company_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config res_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config
    ADD CONSTRAINT res_config_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_auth_signup_template_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_auth_signup_template_user_id_fkey FOREIGN KEY (auth_signup_template_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_config_settings res_config_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_digest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_digest_id_fkey FOREIGN KEY (digest_id) REFERENCES public.digest_digest(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_invoice_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_invoice_mail_template_id_fkey FOREIGN KEY (invoice_mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: res_config_settings res_config_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config res_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_config
    ADD CONSTRAINT res_config_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_address_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_address_view_id_fkey FOREIGN KEY (address_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: res_country_group res_country_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group
    ADD CONSTRAINT res_country_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE CASCADE;


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_group_res_country_state_rel res_country_group_res_country_state_r_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group_res_country_state_rel
    ADD CONSTRAINT res_country_group_res_country_state_r_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_group_res_country_state_rel res_country_group_res_country_state_r_res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group_res_country_state_rel
    ADD CONSTRAINT res_country_group_res_country_state_r_res_country_state_id_fkey FOREIGN KEY (res_country_state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: res_country_group res_country_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_group
    ADD CONSTRAINT res_country_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_id_fkey FOREIGN KEY (res_country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: res_country_state res_country_state_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_country_state res_country_state_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country_state res_country_state_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency res_currency_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency
    ADD CONSTRAINT res_currency_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: res_currency_rate res_currency_rate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_currency res_currency_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_currency
    ADD CONSTRAINT res_currency_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_device_log res_device_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_device_log
    ADD CONSTRAINT res_device_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_device_log res_device_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_device_log
    ADD CONSTRAINT res_device_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_device_log res_device_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_device_log
    ADD CONSTRAINT res_device_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups res_groups_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups_implied_rel res_groups_implied_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_implied_rel res_groups_implied_rel_hid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_hid_fkey FOREIGN KEY (hid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_privilege res_groups_privilege_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_privilege
    ADD CONSTRAINT res_groups_privilege_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: res_groups_privilege res_groups_privilege_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_privilege
    ADD CONSTRAINT res_groups_privilege_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups res_groups_privilege_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_privilege_id_fkey FOREIGN KEY (privilege_id) REFERENCES public.res_groups_privilege(id) ON DELETE SET NULL;


--
-- Name: res_groups_privilege res_groups_privilege_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_privilege
    ADD CONSTRAINT res_groups_privilege_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_groups_report_rel res_groups_report_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_report_rel res_groups_report_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.ir_act_report_xml(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey FOREIGN KEY (spreadsheet_dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_groups_website_menu_rel res_groups_website_menu_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_website_menu_rel
    ADD CONSTRAINT res_groups_website_menu_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_website_menu_rel res_groups_website_menu_rel_website_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups_website_menu_rel
    ADD CONSTRAINT res_groups_website_menu_rel_website_menu_id_fkey FOREIGN KEY (website_menu_id) REFERENCES public.website_menu(id) ON DELETE CASCADE;


--
-- Name: res_groups res_groups_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_lang res_lang_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_lang
    ADD CONSTRAINT res_lang_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_lang_install_rel res_lang_install_rel_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE CASCADE;


--
-- Name: res_lang_install_rel res_lang_install_rel_language_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_language_wizard_id_fkey FOREIGN KEY (language_wizard_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: res_lang res_lang_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_lang
    ADD CONSTRAINT res_lang_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_bank_id_fkey FOREIGN KEY (bank_id) REFERENCES public.res_bank(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner_bank res_partner_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_category res_partner_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_category res_partner_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: res_partner_category res_partner_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_category
    ADD CONSTRAINT res_partner_category_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_industry res_partner_industry_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_industry
    ADD CONSTRAINT res_partner_industry_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_industry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_industry_id_fkey FOREIGN KEY (industry_id) REFERENCES public.res_partner_industry(id) ON DELETE SET NULL;


--
-- Name: res_partner_industry res_partner_industry_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_industry
    ADD CONSTRAINT res_partner_industry_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_invoice_template_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_invoice_template_pdf_report_id_fkey FOREIGN KEY (invoice_template_pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner res_partner_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_role res_role_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_role
    ADD CONSTRAINT res_role_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_role_res_users_rel res_role_res_users_rel_res_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_role_res_users_rel
    ADD CONSTRAINT res_role_res_users_rel_res_role_id_fkey FOREIGN KEY (res_role_id) REFERENCES public.res_role(id) ON DELETE CASCADE;


--
-- Name: res_role_res_users_rel res_role_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_role_res_users_rel
    ADD CONSTRAINT res_role_res_users_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_role res_role_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_role
    ADD CONSTRAINT res_role_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys_description res_users_apikeys_description_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_apikeys_description
    ADD CONSTRAINT res_users_apikeys_description_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys_description res_users_apikeys_description_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_apikeys_description
    ADD CONSTRAINT res_users_apikeys_description_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_apikeys res_users_apikeys_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_apikeys
    ADD CONSTRAINT res_users_apikeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users res_users_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_identitycheck res_users_identitycheck_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_identitycheck
    ADD CONSTRAINT res_users_identitycheck_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_identitycheck res_users_identitycheck_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_identitycheck
    ADD CONSTRAINT res_users_identitycheck_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_log res_users_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_log
    ADD CONSTRAINT res_users_log_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_log res_users_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_log
    ADD CONSTRAINT res_users_log_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_sale_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_sale_team_id_fkey FOREIGN KEY (sale_team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_user_setting_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_user_setting_id_fkey FOREIGN KEY (user_setting_id) REFERENCES public.res_users_settings(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_spreadsheet_dashboard_rel res_users_spreadsheet_dashboard_r_spreadsheet_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_users_spreadsheet_dashboard_r_spreadsheet_dashboard_id_fkey FOREIGN KEY (spreadsheet_dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: res_users_spreadsheet_dashboard_rel res_users_spreadsheet_dashboard_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_users_spreadsheet_dashboard_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_web_tour_tour_rel res_users_web_tour_tour_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_web_tour_tour_rel
    ADD CONSTRAINT res_users_web_tour_tour_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_web_tour_tour_rel res_users_web_tour_tour_rel_web_tour_tour_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users_web_tour_tour_rel
    ADD CONSTRAINT res_users_web_tour_tour_rel_web_tour_tour_id_fkey FOREIGN KEY (web_tour_tour_id) REFERENCES public.web_tour_tour(id) ON DELETE CASCADE;


--
-- Name: res_users res_users_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_compare_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_compare_view_id_fkey FOREIGN KEY (compare_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE CASCADE;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: rule_group_rel rule_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: rule_group_rel rule_group_rel_rule_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_rule_group_id_fkey FOREIGN KEY (rule_group_id) REFERENCES public.ir_rule(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey FOREIGN KEY (sale_advance_payment_inv_id) REFERENCES public.sale_advance_payment_inv(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_mass_cancel_orders sale_mass_cancel_orders_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_mass_cancel_orders
    ADD CONSTRAINT sale_mass_cancel_orders_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_mass_cancel_orders sale_mass_cancel_orders_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_mass_cancel_orders
    ADD CONSTRAINT sale_mass_cancel_orders_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES public.delivery_carrier(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: sale_order_discount sale_order_discount_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_discount
    ADD CONSTRAINT sale_order_discount_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_discount sale_order_discount_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_discount
    ADD CONSTRAINT sale_order_discount_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_discount sale_order_discount_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_discount
    ADD CONSTRAINT sale_order_discount_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_combo_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_combo_item_id_fkey FOREIGN KEY (combo_item_id) REFERENCES public.product_combo_item(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_event_slot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_event_slot_id_fkey FOREIGN KEY (event_slot_id) REFERENCES public.event_slot(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_event_ticket_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_event_ticket_id_fkey FOREIGN KEY (event_ticket_id) REFERENCES public.event_event_ticket(id) ON DELETE SET NULL;


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_invoice_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_invoice_line_id_fkey FOREIGN KEY (invoice_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_order_line_id_fkey FOREIGN KEY (order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_linked_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_linked_line_id_fkey FOREIGN KEY (linked_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_partner_id_fkey FOREIGN KEY (order_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sale_order_line_product_document_rel sale_order_line_product_document_rel_product_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line_product_document_rel
    ADD CONSTRAINT sale_order_line_product_document_rel_product_document_id_fkey FOREIGN KEY (product_document_id) REFERENCES public.product_document(id) ON DELETE CASCADE;


--
-- Name: sale_order_line_product_document_rel sale_order_line_product_document_rel_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line_product_document_rel
    ADD CONSTRAINT sale_order_line_product_document_rel_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_salesman_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_salesman_id_fkey FOREIGN KEY (salesman_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_mass_cancel_wizard_rel sale_order_mass_cancel_wizard_r_sale_mass_cancel_orders_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_mass_cancel_wizard_rel
    ADD CONSTRAINT sale_order_mass_cancel_wizard_r_sale_mass_cancel_orders_id_fkey FOREIGN KEY (sale_mass_cancel_orders_id) REFERENCES public.sale_mass_cancel_orders(id) ON DELETE CASCADE;


--
-- Name: sale_order_mass_cancel_wizard_rel sale_order_mass_cancel_wizard_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_mass_cancel_wizard_rel
    ADD CONSTRAINT sale_order_mass_cancel_wizard_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_option sale_order_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_invoice_id_fkey FOREIGN KEY (partner_invoice_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_payment_term_id_fkey FOREIGN KEY (payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_pending_email_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_pending_email_template_id_fkey FOREIGN KEY (pending_email_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: sale_order_spreadsheet sale_order_spreadsheet_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_spreadsheet
    ADD CONSTRAINT sale_order_spreadsheet_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_spreadsheet sale_order_spreadsheet_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_spreadsheet
    ADD CONSTRAINT sale_order_spreadsheet_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_spreadsheet sale_order_spreadsheet_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_spreadsheet
    ADD CONSTRAINT sale_order_spreadsheet_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_spreadsheet sale_order_spreadsheet_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_spreadsheet
    ADD CONSTRAINT sale_order_spreadsheet_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.crm_tag(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_line sale_order_template_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_option sale_order_template_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_spreadsheet_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_spreadsheet_template_id_fkey FOREIGN KEY (spreadsheet_template_id) REFERENCES public.sale_order_spreadsheet(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_payment_provider_onboarding_wizard
    ADD CONSTRAINT sale_payment_provider_onboarding_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_payment_provider_onboarding_wizard
    ADD CONSTRAINT sale_payment_provider_onboarding_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_pdf_form_field sale_pdf_form_field_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_pdf_form_field
    ADD CONSTRAINT sale_pdf_form_field_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_pdf_form_field sale_pdf_form_field_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sale_pdf_form_field
    ADD CONSTRAINT sale_pdf_form_field_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: scheduled_message_attachment_rel scheduled_message_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.scheduled_message_attachment_rel
    ADD CONSTRAINT scheduled_message_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: scheduled_message_attachment_rel scheduled_message_attachment_rel_scheduled_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.scheduled_message_attachment_rel
    ADD CONSTRAINT scheduled_message_attachment_rel_scheduled_message_id_fkey FOREIGN KEY (scheduled_message_id) REFERENCES public.mail_scheduled_message(id) ON DELETE CASCADE;


--
-- Name: sms_account_code sms_account_code_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_code
    ADD CONSTRAINT sms_account_code_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_code sms_account_code_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_code
    ADD CONSTRAINT sms_account_code_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_account_code sms_account_code_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_code
    ADD CONSTRAINT sms_account_code_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_account_phone sms_account_phone_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_phone
    ADD CONSTRAINT sms_account_phone_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_phone sms_account_phone_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_phone
    ADD CONSTRAINT sms_account_phone_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_account_phone sms_account_phone_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_phone
    ADD CONSTRAINT sms_account_phone_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_account_sender sms_account_sender_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_sender
    ADD CONSTRAINT sms_account_sender_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_sender sms_account_sender_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_sender
    ADD CONSTRAINT sms_account_sender_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_account_sender sms_account_sender_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_account_sender
    ADD CONSTRAINT sms_account_sender_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_preview sms_template_preview_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_reset sms_template_reset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_reset
    ADD CONSTRAINT sms_template_reset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template_reset sms_template_reset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_reset
    ADD CONSTRAINT sms_template_reset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_template sms_template_sidebar_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_sidebar_action_id_fkey FOREIGN KEY (sidebar_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_reset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_reset_id_fkey FOREIGN KEY (sms_template_reset_id) REFERENCES public.sms_template_reset(id) ON DELETE CASCADE;


--
-- Name: sms_template sms_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_tracker sms_tracker_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_tracker
    ADD CONSTRAINT sms_tracker_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sms_tracker sms_tracker_mail_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_tracker
    ADD CONSTRAINT sms_tracker_mail_notification_id_fkey FOREIGN KEY (mail_notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: sms_tracker sms_tracker_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sms_tracker
    ADD CONSTRAINT sms_tracker_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: snailmail_letter snailmail_letter_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_report_template_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_report_template_fkey FOREIGN KEY (report_template) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_cell_thread spreadsheet_cell_thread_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_cell_thread
    ADD CONSTRAINT spreadsheet_cell_thread_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_cell_thread spreadsheet_cell_thread_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_cell_thread
    ADD CONSTRAINT spreadsheet_cell_thread_dashboard_id_fkey FOREIGN KEY (dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: spreadsheet_cell_thread spreadsheet_cell_thread_sale_order_spreadsheet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_cell_thread
    ADD CONSTRAINT spreadsheet_cell_thread_sale_order_spreadsheet_id_fkey FOREIGN KEY (sale_order_spreadsheet_id) REFERENCES public.sale_order_spreadsheet(id) ON DELETE CASCADE;


--
-- Name: spreadsheet_cell_thread spreadsheet_cell_thread_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_cell_thread
    ADD CONSTRAINT spreadsheet_cell_thread_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_dashboard_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_dashboard_group_id_fkey FOREIGN KEY (dashboard_group_id) REFERENCES public.spreadsheet_dashboard_group(id) ON DELETE RESTRICT;


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard_group
    ADD CONSTRAINT spreadsheet_dashboard_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard_group
    ADD CONSTRAINT spreadsheet_dashboard_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard_share
    ADD CONSTRAINT spreadsheet_dashboard_share_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard_share
    ADD CONSTRAINT spreadsheet_dashboard_share_dashboard_id_fkey FOREIGN KEY (dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard_share
    ADD CONSTRAINT spreadsheet_dashboard_share_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_revision spreadsheet_revision_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_revision
    ADD CONSTRAINT spreadsheet_revision_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: spreadsheet_revision spreadsheet_revision_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_revision
    ADD CONSTRAINT spreadsheet_revision_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_revision spreadsheet_revision_parent_revision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_revision
    ADD CONSTRAINT spreadsheet_revision_parent_revision_id_fkey FOREIGN KEY (parent_revision_id) REFERENCES public.spreadsheet_revision(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_revision spreadsheet_revision_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.spreadsheet_revision
    ADD CONSTRAINT spreadsheet_revision_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE CASCADE;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: theme_ir_asset theme_ir_asset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_asset
    ADD CONSTRAINT theme_ir_asset_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_asset theme_ir_asset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_asset
    ADD CONSTRAINT theme_ir_asset_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_attachment theme_ir_attachment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_attachment
    ADD CONSTRAINT theme_ir_attachment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_attachment theme_ir_attachment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_attachment
    ADD CONSTRAINT theme_ir_attachment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_ui_view theme_ir_ui_view_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_ui_view
    ADD CONSTRAINT theme_ir_ui_view_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_ir_ui_view theme_ir_ui_view_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_ir_ui_view
    ADD CONSTRAINT theme_ir_ui_view_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_menu theme_website_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_menu theme_website_menu_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.theme_website_page(id) ON DELETE CASCADE;


--
-- Name: theme_website_menu theme_website_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.theme_website_menu(id) ON DELETE CASCADE;


--
-- Name: theme_website_menu theme_website_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_menu
    ADD CONSTRAINT theme_website_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_page theme_website_page_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: theme_website_page theme_website_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.theme_ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: theme_website_page theme_website_page_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.theme_website_page
    ADD CONSTRAINT theme_website_page_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_uom uom_uom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: uom_uom uom_uom_relative_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_relative_uom_id_fkey FOREIGN KEY (relative_uom_id) REFERENCES public.uom_uom(id) ON DELETE CASCADE;


--
-- Name: uom_uom uom_uom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: update_product_attribute_value update_product_attribute_value_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.update_product_attribute_value
    ADD CONSTRAINT update_product_attribute_value_attribute_value_id_fkey FOREIGN KEY (attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE CASCADE;


--
-- Name: update_product_attribute_value update_product_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.update_product_attribute_value
    ADD CONSTRAINT update_product_attribute_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: update_product_attribute_value update_product_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.update_product_attribute_value
    ADD CONSTRAINT update_product_attribute_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.utm_stage(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_medium utm_medium_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_medium
    ADD CONSTRAINT utm_medium_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_medium utm_medium_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_medium
    ADD CONSTRAINT utm_medium_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_source utm_source_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_source
    ADD CONSTRAINT utm_source_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_source utm_source_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_source
    ADD CONSTRAINT utm_source_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_stage utm_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_stage
    ADD CONSTRAINT utm_stage_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_stage utm_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_stage
    ADD CONSTRAINT utm_stage_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_tag utm_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_tag
    ADD CONSTRAINT utm_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: utm_tag_rel utm_tag_rel_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_tag(id) ON DELETE CASCADE;


--
-- Name: utm_tag_rel utm_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.utm_campaign(id) ON DELETE CASCADE;


--
-- Name: utm_tag utm_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.utm_tag
    ADD CONSTRAINT utm_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: validate_account_move validate_account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.validate_account_move
    ADD CONSTRAINT validate_account_move_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: validate_account_move validate_account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.validate_account_move
    ADD CONSTRAINT validate_account_move_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_many2one_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_many2one_fkey FOREIGN KEY (many2one) REFERENCES public.web_editor_converter_test_sub(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_editor_converter_test_sub
    ADD CONSTRAINT web_editor_converter_test_sub_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_editor_converter_test_sub
    ADD CONSTRAINT web_editor_converter_test_sub_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test web_editor_converter_test_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_tour_tour web_tour_tour_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_tour_tour
    ADD CONSTRAINT web_tour_tour_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_tour_tour_step web_tour_tour_step_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_tour_tour_step
    ADD CONSTRAINT web_tour_tour_step_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_tour_tour_step web_tour_tour_step_tour_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_tour_tour_step
    ADD CONSTRAINT web_tour_tour_step_tour_id_fkey FOREIGN KEY (tour_id) REFERENCES public.web_tour_tour(id) ON DELETE CASCADE;


--
-- Name: web_tour_tour_step web_tour_tour_step_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_tour_tour_step
    ADD CONSTRAINT web_tour_tour_step_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: web_tour_tour web_tour_tour_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.web_tour_tour
    ADD CONSTRAINT web_tour_tour_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_base_unit website_base_unit_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_base_unit
    ADD CONSTRAINT website_base_unit_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_base_unit website_base_unit_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_base_unit
    ADD CONSTRAINT website_base_unit_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_cart_recovery_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_cart_recovery_mail_template_id_fkey FOREIGN KEY (cart_recovery_mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: website_checkout_step website_checkout_step_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_checkout_step
    ADD CONSTRAINT website_checkout_step_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_checkout_step website_checkout_step_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_checkout_step
    ADD CONSTRAINT website_checkout_step_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_checkout_step website_checkout_step_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_checkout_step
    ADD CONSTRAINT website_checkout_step_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: website_configurator_feature website_configurator_feature_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_configurator_feature website_configurator_feature_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: website_configurator_feature website_configurator_feature_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_page_view_id_fkey FOREIGN KEY (page_view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_configurator_feature website_configurator_feature_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_configurator_feature
    ADD CONSTRAINT website_configurator_feature_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_controller_page website_controller_page_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_controller_page
    ADD CONSTRAINT website_controller_page_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_controller_page website_controller_page_record_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_controller_page
    ADD CONSTRAINT website_controller_page_record_view_id_fkey FOREIGN KEY (record_view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_controller_page website_controller_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_controller_page
    ADD CONSTRAINT website_controller_page_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_controller_page website_controller_page_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_controller_page
    ADD CONSTRAINT website_controller_page_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_controller_page website_controller_page_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_controller_page
    ADD CONSTRAINT website_controller_page_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_custom_blocked_third_party_domains website_custom_blocked_third_party_domains_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_custom_blocked_third_party_domains
    ADD CONSTRAINT website_custom_blocked_third_party_domains_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_custom_blocked_third_party_domains website_custom_blocked_third_party_domains_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_custom_blocked_third_party_domains
    ADD CONSTRAINT website_custom_blocked_third_party_domains_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_default_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_default_lang_id_fkey FOREIGN KEY (default_lang_id) REFERENCES public.res_lang(id) ON DELETE RESTRICT;


--
-- Name: website_event_menu website_event_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_event_menu
    ADD CONSTRAINT website_event_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_event_menu website_event_menu_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_event_menu
    ADD CONSTRAINT website_event_menu_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.event_event(id) ON DELETE CASCADE;


--
-- Name: website_event_menu website_event_menu_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_event_menu
    ADD CONSTRAINT website_event_menu_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.website_menu(id) ON DELETE CASCADE;


--
-- Name: website_event_menu website_event_menu_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_event_menu
    ADD CONSTRAINT website_event_menu_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_event_menu website_event_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_event_menu
    ADD CONSTRAINT website_event_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_lang_rel website_lang_rel_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_lang_rel
    ADD CONSTRAINT website_lang_rel_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE CASCADE;


--
-- Name: website_lang_rel website_lang_rel_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_lang_rel
    ADD CONSTRAINT website_lang_rel_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_controller_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_controller_page_id_fkey FOREIGN KEY (controller_page_id) REFERENCES public.website_controller_page(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_menu website_menu_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.website_page(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.website_menu(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_website_menu(id) ON DELETE SET NULL;


--
-- Name: website_menu website_menu_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_menu website_menu_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_menu
    ADD CONSTRAINT website_menu_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page_properties_base website_page_properties_base_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties_base
    ADD CONSTRAINT website_page_properties_base_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page_properties_base website_page_properties_base_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties_base
    ADD CONSTRAINT website_page_properties_base_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_page_properties_base website_page_properties_base_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties_base
    ADD CONSTRAINT website_page_properties_base_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page_properties website_page_properties_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties
    ADD CONSTRAINT website_page_properties_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page_properties website_page_properties_target_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties
    ADD CONSTRAINT website_page_properties_target_model_id_fkey FOREIGN KEY (target_model_id) REFERENCES public.website_page(id) ON DELETE SET NULL;


--
-- Name: website_page_properties website_page_properties_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties
    ADD CONSTRAINT website_page_properties_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_page_properties website_page_properties_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page_properties
    ADD CONSTRAINT website_page_properties_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_theme_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_theme_template_id_fkey FOREIGN KEY (theme_template_id) REFERENCES public.theme_website_page(id) ON DELETE SET NULL;


--
-- Name: website_page website_page_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE CASCADE;


--
-- Name: website_page website_page_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_page website_page_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_page
    ADD CONSTRAINT website_page_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.website_route(id) ON DELETE SET NULL;


--
-- Name: website_rewrite website_rewrite_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_rewrite website_rewrite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_rewrite
    ADD CONSTRAINT website_rewrite_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_robots website_robots_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_robots
    ADD CONSTRAINT website_robots_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_robots website_robots_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_robots
    ADD CONSTRAINT website_robots_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_route website_route_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_route
    ADD CONSTRAINT website_route_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_route website_route_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_route
    ADD CONSTRAINT website_route_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_sale_extra_field website_sale_extra_field_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_sale_extra_field
    ADD CONSTRAINT website_sale_extra_field_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_sale_extra_field website_sale_extra_field_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_sale_extra_field
    ADD CONSTRAINT website_sale_extra_field_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE CASCADE;


--
-- Name: website_sale_extra_field website_sale_extra_field_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_sale_extra_field
    ADD CONSTRAINT website_sale_extra_field_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: website_sale_extra_field website_sale_extra_field_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_sale_extra_field
    ADD CONSTRAINT website_sale_extra_field_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_salesperson_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_salesperson_id_fkey FOREIGN KEY (salesperson_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_salesteam_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_salesteam_id_fkey FOREIGN KEY (salesteam_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: website_snippet_filter website_snippet_filter_action_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_action_server_id_fkey FOREIGN KEY (action_server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_snippet_filter website_snippet_filter_filter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_filter_id_fkey FOREIGN KEY (filter_id) REFERENCES public.ir_filters(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: website_snippet_filter website_snippet_filter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_snippet_filter
    ADD CONSTRAINT website_snippet_filter_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_theme_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_theme_id_fkey FOREIGN KEY (theme_id) REFERENCES public.ir_module_module(id) ON DELETE SET NULL;


--
-- Name: website_track website_track_page_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_page_id_fkey FOREIGN KEY (page_id) REFERENCES public.website_page(id) ON DELETE CASCADE;


--
-- Name: website_track website_track_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: website_track website_track_visitor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_visitor_id_fkey FOREIGN KEY (visitor_id) REFERENCES public.website_visitor(id) ON DELETE CASCADE;


--
-- Name: website website_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: website_visitor website_visitor_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE SET NULL;


--
-- Name: website_visitor website_visitor_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: website website_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.website
    ADD CONSTRAINT website_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.ir_ui_menu(id) ON DELETE CASCADE;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
--

GRANT CREATE ON SCHEMA public TO odoo;


--
--

\unrestrict 8QnTcfvbvBgD5jX50YQtKw2Z3hWBFL4AshUKU3rihQgCnAVziwL4FWNCdc01D0c

;
SELECT pg_catalog.set_config('search_path', 'public', false);
UPDATE ir_config_parameter SET value='e7ba4763-2489-43ba-bd2a-8b2d3c58c795' WHERE key='database.uuid';
DO $$BEGIN
  IF EXISTS (
      SELECT * FROM information_schema.columns
      WHERE table_schema = 'public'
          AND table_name   = 'auth_oauth_provider'
          AND column_name = 'client_id'
      )
  THEN
      UPDATE auth_oauth_provider
         SET client_id='e7ba4763-2489-43ba-bd2a-8b2d3c58c795'
       WHERE id IN (SELECT res_id
                      FROM ir_model_data
                     WHERE module='auth_oauth'
                       AND name='provider_openerp');
  END IF;
END$$;
UPDATE ir_mail_server
   SET active=true
 WHERE id IN (SELECT res_id
                FROM ir_model_data
               WHERE module='base'
                 AND name='ir_mail_server_localhost0');
UPDATE ir_act_window
   SET help=NULL
 WHERE id IN (SELECT res_id
                FROM ir_model_data
               WHERE module='base'
                 AND name='action_ir_mail_server_list');
WITH views AS (
   DELETE FROM ir_model_data
         WHERE model='ir.ui.view'
           AND module LIKE E'saas\_%'
     RETURNING res_id
)
DELETE FROM ir_ui_view v
      USING views w
      WHERE v.id = w.res_id;
DELETE FROM ir_model_data WHERE module LIKE E'saas\_%';
DELETE FROM ir_model_constraint WHERE module IN (
  SELECT id FROM ir_module_module WHERE name LIKE E'saas\_%');
DELETE FROM ir_model_relation WHERE module IN (
  SELECT id FROM ir_module_module WHERE name LIKE E'saas\_%');
WITH mods AS (
   DELETE FROM ir_module_module
         WHERE name LIKE E'saas\_%'
     RETURNING id
)
DELETE FROM ir_model_data d
      USING mods m
      WHERE model = 'ir.module.module'
        AND d.res_id = m.id;
