-- Name: account_peppol_service account_peppol_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

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_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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_partner_mapping account_reconcile_model_partner_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_pa_account_reconcile_model_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_pa_account_reconcile_model_id_fkey1 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_par_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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_category_rel account_reconcile_model_res_partne_res_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_partne_res_partner_category_id_fkey FOREIGN KEY (res_partner_category_id) REFERENCES public.res_partner_category(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: odoo
--

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: odoo
--

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_report_column account_report_column_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_expression account_report_expression_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_foreign_vat_fiscal_position__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_foreign_vat_fiscal_position__fkey FOREIGN KEY (foreign_vat_fiscal_position_id) REFERENCES public.account_fiscal_position(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: odoo
--

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: odoo
--

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_line account_report_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 account_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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_resequence_wizard account_resequence_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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_secure_entries_wizard account_secure_entries_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 account_tax_cash_basis_transition_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_purchase_order_line_rel account_tax_purchase_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_purchase_order_line_rel account_tax_purchase_order_line_rel_purchase_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_purchase_order_line_rel
    ADD CONSTRAINT account_tax_purchase_order_line_rel_purchase_order_line_id_fkey FOREIGN KEY (purchase_order_line_id) REFERENCES public.purchase_order_line(id) ON DELETE CASCADE;


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

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_discount_rel account_tax_sale_order_discount_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_sale_order_discount_rel account_tax_sale_order_discount_rel_sale_order_discount_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_discount_rel
    ADD CONSTRAINT account_tax_sale_order_discount_rel_sale_order_discount_id_fkey FOREIGN KEY (sale_order_discount_id) REFERENCES public.sale_order_discount(id) ON DELETE CASCADE;


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

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: odoo
--

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: odoo
--

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 account_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: activity_attachment_rel activity_attachment_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: auth_totp_device auth_totp_device_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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_wizard auth_totp_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_badge_id_fkey FOREIGN KEY (gamification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_goal_definition_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_goal_definition_fkey FOREIGN KEY (gamification_goal_definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


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

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: odoo
--

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_associated_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_associated_uom_id_fkey FOREIGN KEY (associated_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


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

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 base_module_uninstall_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_module_uninstall
    ADD CONSTRAINT base_module_uninstall_module_id_fkey FOREIGN KEY (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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: bill_to_po_wizard bill_to_po_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE SET NULL;


--
-- Name: bill_to_po_wizard bill_to_po_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_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: odoo
--

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: odoo
--

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: bus_presence bus_presence_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_presence bus_presence_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm_calendar_event_rel
    ADD CONSTRAINT calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey FOREIGN KEY (calendar_alarm_id) REFERENCES public.calendar_alarm(id) ON DELETE RESTRICT;


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm_calendar_event_rel
    ADD CONSTRAINT calendar_alarm_calendar_event_rel_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_alarm calendar_alarm_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm
    ADD CONSTRAINT calendar_alarm_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: calendar_alarm calendar_alarm_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_attendee
    ADD CONSTRAINT calendar_attendee_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_attendee calendar_attendee_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_recurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_recurrence_id_fkey FOREIGN KEY (recurrence_id) REFERENCES public.calendar_recurrence(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event_res_partner_rel
    ADD CONSTRAINT calendar_event_res_partner_rel_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_type calendar_event_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_type calendar_event_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_videocall_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_videocall_channel_id_fkey FOREIGN KEY (videocall_channel_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_record_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_popover_delete_wizard
    ADD CONSTRAINT calendar_popover_delete_wizard_record_fkey FOREIGN KEY (record) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_base_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_base_event_id_fkey FOREIGN KEY (base_event_id) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_trigger_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_trigger_id_fkey FOREIGN KEY (trigger_id) REFERENCES public.ir_cron_trigger(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_public_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_public_key_id_fkey FOREIGN KEY (public_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_key
    ADD CONSTRAINT certificate_key_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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: confirm_stock_sms confirm_stock_sms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: confirm_stock_sms confirm_stock_sms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.confirm_stock_sms
    ADD CONSTRAINT confirm_stock_sms_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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: digest_digest digest_digest_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_channel discuss_channel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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_hr_department_rel discuss_channel_hr_department_rel_discuss_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: discuss_channel_hr_department_rel discuss_channel_hr_department_rel_hr_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.discuss_channel_hr_department_rel
    ADD CONSTRAINT discuss_channel_hr_department_rel_hr_department_id_fkey FOREIGN KEY (hr_department_id) REFERENCES public.hr_department(id) ON DELETE CASCADE;


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

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: email_template_attachment_rel email_template_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: employee_category_rel employee_category_rel_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.employee_category_rel
    ADD CONSTRAINT employee_category_rel_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.hr_employee_category(id) ON DELETE CASCADE;


--
-- Name: employee_category_rel employee_category_rel_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.employee_category_rel
    ADD CONSTRAINT employee_category_rel_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: fetchmail_server fetchmail_server_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: gamification_badge gamification_badge_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_rule_badge_rel gamification_badge_rule_badge_rel_badge1_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_rule_badge_rel
    ADD CONSTRAINT gamification_badge_rule_badge_rel_badge1_id_fkey FOREIGN KEY (badge1_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_rule_badge_rel gamification_badge_rule_badge_rel_badge2_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_rule_badge_rel
    ADD CONSTRAINT gamification_badge_rule_badge_rel_badge2_id_fkey FOREIGN KEY (badge2_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user gamification_badge_user_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user gamification_badge_user_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE SET NULL;


--
-- Name: gamification_badge_user gamification_badge_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: gamification_badge_user gamification_badge_user_sender_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user
    ADD CONSTRAINT gamification_badge_user_sender_id_fkey FOREIGN KEY (sender_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_badge_user gamification_badge_user_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user_wizard
    ADD CONSTRAINT gamification_badge_user_wizard_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_badge_user_wizard
    ADD CONSTRAINT gamification_badge_user_wizard_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user_wizard gamification_badge_user_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge_user gamification_badge_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_badge gamification_badge_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge gamification_challenge_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge_line gamification_challenge_line_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge_line
    ADD CONSTRAINT gamification_challenge_line_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE CASCADE;


--
-- Name: gamification_challenge_line gamification_challenge_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge_line gamification_challenge_line_definition_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge_line
    ADD CONSTRAINT gamification_challenge_line_definition_id_fkey FOREIGN KEY (definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


--
-- Name: gamification_challenge_line gamification_challenge_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge gamification_challenge_manager_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_manager_id_fkey FOREIGN KEY (manager_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge gamification_challenge_report_message_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_report_message_group_id_fkey FOREIGN KEY (report_message_group_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge gamification_challenge_report_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_report_template_id_fkey FOREIGN KEY (report_template_id) REFERENCES public.mail_template(id) ON DELETE RESTRICT;


--
-- Name: gamification_challenge gamification_challenge_reward_first_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_first_id_fkey FOREIGN KEY (reward_first_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge gamification_challenge_reward_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_id_fkey FOREIGN KEY (reward_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge gamification_challenge_reward_second_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_second_id_fkey FOREIGN KEY (reward_second_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge gamification_challenge_reward_third_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge
    ADD CONSTRAINT gamification_challenge_reward_third_id_fkey FOREIGN KEY (reward_third_id) REFERENCES public.gamification_badge(id) ON DELETE SET NULL;


--
-- Name: gamification_challenge_users_rel gamification_challenge_users_rel_gamification_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_challenge_users_rel
    ADD CONSTRAINT gamification_challenge_users_rel_gamification_challenge_id_fkey FOREIGN KEY (gamification_challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE CASCADE;


--
-- Name: gamification_challenge_users_rel gamification_challenge_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_challenge gamification_challenge_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal gamification_goal_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_challenge_id_fkey FOREIGN KEY (challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal_definition gamification_goal_definition_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_action_id_fkey FOREIGN KEY (action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_batch_distinctive_field_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_batch_distinctive_field_fkey FOREIGN KEY (batch_distinctive_field) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal_definition gamification_goal_definition_field_date_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_field_date_id_fkey FOREIGN KEY (field_date_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal_definition gamification_goal_definition_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_field_id_fkey FOREIGN KEY (field_id) REFERENCES public.ir_model_fields(id) ON DELETE SET NULL;


--
-- Name: gamification_goal gamification_goal_definition_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_definition_id_fkey FOREIGN KEY (definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_definition gamification_goal_definition_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_definition
    ADD CONSTRAINT gamification_goal_definition_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_definition gamification_goal_definition_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal gamification_goal_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal
    ADD CONSTRAINT gamification_goal_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.gamification_challenge_line(id) ON DELETE CASCADE;


--
-- Name: gamification_goal gamification_goal_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal_wizard gamification_goal_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal_wizard gamification_goal_wizard_goal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_goal_wizard
    ADD CONSTRAINT gamification_goal_wizard_goal_id_fkey FOREIGN KEY (goal_id) REFERENCES public.gamification_goal(id) ON DELETE CASCADE;


--
-- Name: gamification_goal_wizard gamification_goal_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_goal gamification_goal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_invited_user_ids_rel gamification_invited_user_ids_re_gamification_challenge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_invited_user_ids_rel
    ADD CONSTRAINT gamification_invited_user_ids_re_gamification_challenge_id_fkey FOREIGN KEY (gamification_challenge_id) REFERENCES public.gamification_challenge(id) ON DELETE CASCADE;


--
-- Name: gamification_invited_user_ids_rel gamification_invited_user_ids_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_karma_rank gamification_karma_rank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_karma_rank gamification_karma_rank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_karma_tracking gamification_karma_tracking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_karma_tracking gamification_karma_tracking_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: gamification_karma_tracking gamification_karma_tracking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.gamification_karma_tracking
    ADD CONSTRAINT gamification_karma_tracking_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: odoo
--

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: odoo
--

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: hr_contract_type hr_contract_type_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_contract_type hr_contract_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_contract_type hr_contract_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_department hr_department_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_department hr_department_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_department hr_department_manager_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_manager_id_fkey FOREIGN KEY (manager_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_master_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_department
    ADD CONSTRAINT hr_department_master_department_id_fkey FOREIGN KEY (master_department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_department hr_department_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_department hr_department_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_departure_reason hr_departure_reason_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_departure_reason hr_departure_reason_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_departure_wizard hr_departure_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_departure_wizard hr_departure_wizard_departure_reason_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_departure_reason_id_fkey FOREIGN KEY (departure_reason_id) REFERENCES public.hr_departure_reason(id) ON DELETE CASCADE;


--
-- Name: hr_departure_wizard hr_departure_wizard_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_departure_wizard
    ADD CONSTRAINT hr_departure_wizard_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_departure_wizard hr_departure_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_bank_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: hr_employee_category hr_employee_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_category hr_employee_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_coach_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_coach_id_fkey FOREIGN KEY (coach_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_country_of_birth_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_country_of_birth_fkey FOREIGN KEY (country_of_birth) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_cv_wizard hr_employee_cv_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_cv_wizard hr_employee_cv_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_departure_reason_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_departure_reason_id_fkey FOREIGN KEY (departure_reason_id) REFERENCES public.hr_departure_reason(id) ON DELETE RESTRICT;


--
-- Name: hr_employee_hr_employee_cv_wizard_rel hr_employee_hr_employee_cv_wizard_hr_employee_cv_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_cv_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_cv_wizard_hr_employee_cv_wizard_id_fkey FOREIGN KEY (hr_employee_cv_wizard_id) REFERENCES public.hr_employee_cv_wizard(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_employee_cv_wizard_rel hr_employee_hr_employee_cv_wizard_rel_hr_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_employee_cv_wizard_rel
    ADD CONSTRAINT hr_employee_hr_employee_cv_wizard_rel_hr_employee_id_fkey FOREIGN KEY (hr_employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_skill_rel hr_employee_hr_skill_rel_hr_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_skill_rel
    ADD CONSTRAINT hr_employee_hr_skill_rel_hr_employee_id_fkey FOREIGN KEY (hr_employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_hr_skill_rel hr_employee_hr_skill_rel_hr_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_hr_skill_rel
    ADD CONSTRAINT hr_employee_hr_skill_rel_hr_skill_id_fkey FOREIGN KEY (hr_skill_id) REFERENCES public.hr_skill(id) ON DELETE CASCADE;


--
-- Name: hr_employee hr_employee_job_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_job_id_fkey FOREIGN KEY (job_id) REFERENCES public.hr_job(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_private_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_private_country_id_fkey FOREIGN KEY (private_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_private_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_private_state_id_fkey FOREIGN KEY (private_state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE RESTRICT;


--
-- Name: hr_employee_skill hr_employee_skill_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill hr_employee_skill_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill_log hr_employee_skill_log_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_id_fkey FOREIGN KEY (skill_id) REFERENCES public.hr_skill(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_level_id_fkey FOREIGN KEY (skill_level_id) REFERENCES public.hr_skill_level(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill_log
    ADD CONSTRAINT hr_employee_skill_log_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill_log hr_employee_skill_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee_skill hr_employee_skill_skill_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_id_fkey FOREIGN KEY (skill_id) REFERENCES public.hr_skill(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_skill_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_level_id_fkey FOREIGN KEY (skill_level_id) REFERENCES public.hr_skill_level(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee_skill
    ADD CONSTRAINT hr_employee_skill_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_employee_skill hr_employee_skill_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_employee hr_employee_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: hr_employee hr_employee_work_contact_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_work_contact_id_fkey FOREIGN KEY (work_contact_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_work_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_employee
    ADD CONSTRAINT hr_employee_work_location_id_fkey FOREIGN KEY (work_location_id) REFERENCES public.hr_work_location(id) ON DELETE SET NULL;


--
-- Name: hr_employee hr_employee_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_job hr_job_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_job hr_job_contract_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_contract_type_id_fkey FOREIGN KEY (contract_type_id) REFERENCES public.hr_contract_type(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_job hr_job_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_job
    ADD CONSTRAINT hr_job_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: hr_job hr_job_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_resume_line
    ADD CONSTRAINT hr_resume_line_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE CASCADE;


--
-- Name: hr_resume_line hr_resume_line_line_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_resume_line
    ADD CONSTRAINT hr_resume_line_line_type_id_fkey FOREIGN KEY (line_type_id) REFERENCES public.hr_resume_line_type(id) ON DELETE SET NULL;


--
-- Name: hr_resume_line_type hr_resume_line_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line_type hr_resume_line_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_resume_line hr_resume_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_level hr_skill_level_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_level hr_skill_level_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_skill_level
    ADD CONSTRAINT hr_skill_level_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_skill_level hr_skill_level_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_skill_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_skill
    ADD CONSTRAINT hr_skill_skill_type_id_fkey FOREIGN KEY (skill_type_id) REFERENCES public.hr_skill_type(id) ON DELETE CASCADE;


--
-- Name: hr_skill_type hr_skill_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill_type hr_skill_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_skill hr_skill_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_work_location hr_work_location_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.hr_work_location
    ADD CONSTRAINT hr_work_location_address_id_fkey FOREIGN KEY (address_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: hr_work_location hr_work_location_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_work_location hr_work_location_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: hr_work_location hr_work_location_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: iap_account iap_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_service iap_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_res_partner_rel ir_act_server_res_partner_rel_ir_act_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 SET NULL;


--
-- Name: ir_cron_trigger ir_cron_trigger_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 ir_filters_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: ir_filters ir_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: journal_account_control_rel journal_account_control_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: journal_account_control_rel journal_account_control_rel_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: l10n_es_edi_facturae_ac_role_type_res_partner_rel l10n_es_edi_facturae_ac_role__l10n_es_edi_facturae_ac_role_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.l10n_es_edi_facturae_ac_role_type_res_partner_rel
    ADD CONSTRAINT l10n_es_edi_facturae_ac_role__l10n_es_edi_facturae_ac_role_fkey FOREIGN KEY (l10n_es_edi_facturae_ac_role_type_id) REFERENCES public.l10n_es_edi_facturae_ac_role_type(id) ON DELETE CASCADE;


--
-- Name: l10n_es_edi_facturae_ac_role_type l10n_es_edi_facturae_ac_role_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: l10n_es_edi_facturae_ac_role_type_res_partner_rel l10n_es_edi_facturae_ac_role_type_res_partn_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: l10n_es_edi_facturae_ac_role_type l10n_es_edi_facturae_ac_role_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker link_tracker_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: link_tracker_click link_tracker_click_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker_click link_tracker_click_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker_click link_tracker_click_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_click
    ADD CONSTRAINT link_tracker_click_link_id_fkey FOREIGN KEY (link_id) REFERENCES public.link_tracker(id) ON DELETE CASCADE;


--
-- Name: link_tracker_click link_tracker_click_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker_code link_tracker_code_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker_code link_tracker_code_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker_code
    ADD CONSTRAINT link_tracker_code_link_id_fkey FOREIGN KEY (link_id) REFERENCES public.link_tracker(id) ON DELETE CASCADE;


--
-- Name: link_tracker_code link_tracker_code_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker link_tracker_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker link_tracker_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.link_tracker
    ADD CONSTRAINT link_tracker_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: link_tracker link_tracker_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: link_tracker link_tracker_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: lot_label_layout lot_label_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: lot_label_layout_stock_move_line_rel lot_label_layout_stock_move_line_rel_lot_label_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout_stock_move_line_rel
    ADD CONSTRAINT lot_label_layout_stock_move_line_rel_lot_label_layout_id_fkey FOREIGN KEY (lot_label_layout_id) REFERENCES public.lot_label_layout(id) ON DELETE CASCADE;


--
-- Name: lot_label_layout_stock_move_line_rel lot_label_layout_stock_move_line_rel_stock_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout_stock_move_line_rel
    ADD CONSTRAINT lot_label_layout_stock_move_line_rel_stock_move_line_id_fkey FOREIGN KEY (stock_move_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: lot_label_layout lot_label_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.lot_label_layout
    ADD CONSTRAINT lot_label_layout_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: odoo
--

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_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: mail_activity mail_activity_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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_plan_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity_plan
    ADD CONSTRAINT mail_activity_plan_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE CASCADE;


--
-- Name: mail_activity_plan_mail_activity_schedule_rel mail_activity_plan_mail_activity_mail_activity_schedule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_plan_template_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_request_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_activity
    ADD CONSTRAINT mail_activity_request_partner_id_fkey FOREIGN KEY (request_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: mail_activity mail_activity_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 mail_activity_schedule_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_mail_message_subtype_rel mail_followers_mail_message_subtyp_mail_message_subtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_link_preview
    ADD CONSTRAINT mail_link_preview_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: mail_link_preview mail_link_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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 mail_message_mail_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_resend_message_rel mail_notification_mail_resend_messa_mail_resend_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification_mail_resend_message_rel
    ADD CONSTRAINT mail_notification_mail_resend_messa_mail_resend_message_id_fkey FOREIGN KEY (mail_resend_message_id) REFERENCES public.mail_resend_message(id) ON DELETE CASCADE;


--
-- Name: mail_notification_mail_resend_message_rel mail_notification_mail_resend_message_mail_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_notification_mail_resend_message_rel
    ADD CONSTRAINT mail_notification_mail_resend_message_mail_notification_id_fkey FOREIGN KEY (mail_notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: mail_notification mail_notification_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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_push mail_push_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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_resend_message mail_resend_message_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: mail_resend_message mail_resend_message_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_message
    ADD CONSTRAINT mail_resend_message_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: mail_resend_message mail_resend_message_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: mail_resend_partner mail_resend_partner_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: mail_resend_partner mail_resend_partner_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_notification_id_fkey FOREIGN KEY (notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: mail_resend_partner mail_resend_partner_resend_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_resend_wizard_id_fkey FOREIGN KEY (resend_wizard_id) REFERENCES public.mail_resend_message(id) ON DELETE SET NULL;


--
-- Name: mail_resend_partner mail_resend_partner_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_resend_partner
    ADD CONSTRAINT mail_resend_partner_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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: mail_wizard_invite mail_wizard_invite_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: mail_wizard_invite_res_partner_rel mail_wizard_invite_res_partner_rel_mail_wizard_invite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.mail_wizard_invite_res_partner_rel
    ADD CONSTRAINT mail_wizard_invite_res_partner_rel_mail_wizard_invite_id_fkey FOREIGN KEY (mail_wizard_invite_id) REFERENCES public.mail_wizard_invite(id) ON DELETE CASCADE;


--
-- Name: mail_wizard_invite_res_partner_rel mail_wizard_invite_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: mail_wizard_invite mail_wizard_invite_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment_category maintenance_equipment_category_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment_category
    ADD CONSTRAINT maintenance_equipment_category_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: maintenance_equipment_category maintenance_equipment_category_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment_category maintenance_equipment_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment maintenance_equipment_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.maintenance_equipment_category(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment_category maintenance_equipment_category_technician_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment_category
    ADD CONSTRAINT maintenance_equipment_category_technician_user_id_fkey FOREIGN KEY (technician_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment_category maintenance_equipment_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment maintenance_equipment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment maintenance_equipment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment maintenance_equipment_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.hr_department(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment maintenance_equipment_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment maintenance_equipment_maintenance_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_maintenance_team_id_fkey FOREIGN KEY (maintenance_team_id) REFERENCES public.maintenance_team(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment maintenance_equipment_owner_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_owner_user_id_fkey FOREIGN KEY (owner_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment maintenance_equipment_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_equipment maintenance_equipment_technician_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_equipment
    ADD CONSTRAINT maintenance_equipment_technician_user_id_fkey FOREIGN KEY (technician_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: maintenance_equipment maintenance_equipment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_request maintenance_request_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.maintenance_equipment_category(id) ON DELETE SET NULL;


--
-- Name: maintenance_request maintenance_request_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_request maintenance_request_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_request maintenance_request_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.hr_employee(id) ON DELETE SET NULL;


--
-- Name: maintenance_request maintenance_request_equipment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_equipment_id_fkey FOREIGN KEY (equipment_id) REFERENCES public.maintenance_equipment(id) ON DELETE RESTRICT;


--
-- Name: maintenance_request maintenance_request_maintenance_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_maintenance_team_id_fkey FOREIGN KEY (maintenance_team_id) REFERENCES public.maintenance_team(id) ON DELETE RESTRICT;


--
-- Name: maintenance_request maintenance_request_owner_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_owner_user_id_fkey FOREIGN KEY (owner_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: maintenance_request maintenance_request_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_request
    ADD CONSTRAINT maintenance_request_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.maintenance_stage(id) ON DELETE RESTRICT;


--
-- Name: maintenance_request maintenance_request_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_request maintenance_request_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_stage maintenance_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_stage maintenance_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_team maintenance_team_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_team maintenance_team_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_team_users_rel maintenance_team_users_rel_maintenance_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.maintenance_team_users_rel
    ADD CONSTRAINT maintenance_team_users_rel_maintenance_team_id_fkey FOREIGN KEY (maintenance_team_id) REFERENCES public.maintenance_team(id) ON DELETE CASCADE;


--
-- Name: maintenance_team_users_rel maintenance_team_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: maintenance_team maintenance_team_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: meeting_category_rel meeting_category_rel_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.meeting_category_rel
    ADD CONSTRAINT meeting_category_rel_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: meeting_category_rel meeting_category_rel_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.meeting_category_rel
    ADD CONSTRAINT meeting_category_rel_type_id_fkey FOREIGN KEY (type_id) REFERENCES public.calendar_event_type(id) ON DELETE CASCADE;


--
-- Name: message_attachment_rel message_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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: odoo
--

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;


--
