-- Name: account_bank_statement_first_line_index_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_first_line_index_idx ON public.account_bank_statement USING btree (journal_id, first_line_index);


--
-- Name: INDEX account_bank_statement_first_line_index_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_bank_statement_first_line_index_idx IS 'INDEX (journal_id, first_line_index)';


--
-- Name: account_bank_statement_ir_att_ir_attachment_id_account_bank_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_ir_att_ir_attachment_id_account_bank_idx ON public.account_bank_statement_ir_attachment_rel USING btree (ir_attachment_id, account_bank_statement_id);


--
-- Name: account_bank_statement_journal_id_date_desc_id_desc_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_journal_id_date_desc_id_desc_idx ON public.account_bank_statement USING btree (journal_id, date DESC, id DESC);


--
-- Name: INDEX account_bank_statement_journal_id_date_desc_id_desc_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_bank_statement_journal_id_date_desc_id_desc_idx IS 'INDEX (journal_id, date DESC, id DESC)';


--
-- Name: account_bank_statement_line__message_main_attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line__message_main_attachment_id_index ON public.account_bank_statement_line USING btree (message_main_attachment_id) WHERE (message_main_attachment_id IS NOT NULL);


--
-- Name: account_bank_statement_line__move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line__move_id_index ON public.account_bank_statement_line USING btree (move_id);


--
-- Name: account_bank_statement_line__partner_name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line__partner_name_index ON public.account_bank_statement_line USING btree (partner_name) WHERE (partner_name IS NOT NULL);


--
-- Name: account_bank_statement_line__statement_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line__statement_id_index ON public.account_bank_statement_line USING btree (statement_id);


--
-- Name: account_bank_statement_line_main_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line_main_idx ON public.account_bank_statement_line USING btree (journal_id, company_id, internal_index);


--
-- Name: INDEX account_bank_statement_line_main_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_bank_statement_line_main_idx IS 'INDEX (journal_id, company_id, internal_index)';


--
-- Name: account_bank_statement_line_orphan_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line_orphan_idx ON public.account_bank_statement_line USING btree (journal_id, company_id, internal_index) WHERE (statement_id IS NULL);


--
-- Name: INDEX account_bank_statement_line_orphan_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_bank_statement_line_orphan_idx IS 'INDEX (journal_id, company_id, internal_index) WHERE statement_id IS NULL';


--
-- Name: account_bank_statement_line_unreconciled_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_bank_statement_line_unreconciled_idx ON public.account_bank_statement_line USING btree (journal_id, company_id, internal_index) WHERE (is_reconciled IS NOT TRUE);


--
-- Name: INDEX account_bank_statement_line_unreconciled_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_bank_statement_line_unreconciled_idx IS 'INDEX (journal_id, company_id, internal_index) WHERE is_reconciled IS NOT TRUE';


--
-- Name: account_cash_rounding__loss_account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_cash_rounding__loss_account_id_index ON public.account_cash_rounding USING btree (((loss_account_id IS NOT NULL))) WHERE (loss_account_id IS NOT NULL);


--
-- Name: account_cash_rounding__profit_account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_cash_rounding__profit_account_id_index ON public.account_cash_rounding USING btree (((profit_account_id IS NOT NULL))) WHERE (profit_account_id IS NOT NULL);


--
-- Name: account_disallowed_expenses_rate__category_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_disallowed_expenses_rate__category_id_index ON public.account_disallowed_expenses_rate USING btree (category_id);


--
-- Name: account_fiscal_position__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_fiscal_position__company_id_index ON public.account_fiscal_position USING btree (company_id);


--
-- Name: account_fiscal_position_accou_account_tax_id_account_fiscal_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_fiscal_position_accou_account_tax_id_account_fiscal_idx ON public.account_fiscal_position_account_tax_rel USING btree (account_tax_id, account_fiscal_position_id);


--
-- Name: account_fiscal_position_res_c_res_country_state_id_account__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_fiscal_position_res_c_res_country_state_id_account__idx ON public.account_fiscal_position_res_country_state_rel USING btree (res_country_state_id, account_fiscal_position_id);


--
-- Name: account_followup_followup_lin_res_users_id_account_followup_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_followup_followup_lin_res_users_id_account_followup_idx ON public.account_followup_followup_line_res_users_rel USING btree (res_users_id, account_followup_followup_line_id);


--
-- Name: account_followup_manual_remin_ir_attachment_id_account_foll_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_followup_manual_remin_ir_attachment_id_account_foll_idx ON public.account_followup_manual_reminder_ir_attachment_rel USING btree (ir_attachment_id, account_followup_manual_reminder_id);


--
-- Name: account_group__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_group__parent_id_index ON public.account_group USING btree (parent_id);


--
-- Name: account_import_summary_accoun_account_journal_id_account_im_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_import_summary_accoun_account_journal_id_account_im_idx ON public.account_import_summary_account_journal_rel USING btree (account_journal_id, account_import_summary_id);


--
-- Name: account_import_summary_accoun_account_move_id_account_impor_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_import_summary_accoun_account_move_id_account_impor_idx ON public.account_import_summary_account_move_rel USING btree (account_move_id, account_import_summary_id);


--
-- Name: account_import_summary_accoun_account_tax_id_account_import_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_import_summary_accoun_account_tax_id_account_import_idx ON public.account_import_summary_account_tax_rel USING btree (account_tax_id, account_import_summary_id);


--
-- Name: account_import_summary_res_pa_res_partner_id_account_import_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_import_summary_res_pa_res_partner_id_account_import_idx ON public.account_import_summary_res_partner_rel USING btree (res_partner_id, account_import_summary_id);


--
-- Name: account_invoice_transaction_rel_transaction_id_invoice_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_invoice_transaction_rel_transaction_id_invoice_id_idx ON public.account_invoice_transaction_rel USING btree (transaction_id, invoice_id);


--
-- Name: account_journal__account_online_account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_journal__account_online_account_id_index ON public.account_journal USING btree (account_online_account_id) WHERE (account_online_account_id IS NOT NULL);


--
-- Name: account_journal__bank_account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_journal__bank_account_id_index ON public.account_journal USING btree (bank_account_id) WHERE (bank_account_id IS NOT NULL);


--
-- Name: account_journal__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_journal__company_id_index ON public.account_journal USING btree (company_id);


--
-- Name: account_journal_account_journ_account_journal_id_account_jo_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_journal_account_journ_account_journal_id_account_jo_idx ON public.account_journal_account_journal_group_rel USING btree (account_journal_id, account_journal_group_id);


--
-- Name: account_journal_account_recon_account_journal_id_account_re_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_journal_account_recon_account_journal_id_account_re_idx ON public.account_journal_account_reconcile_model_rel USING btree (account_journal_id, account_reconcile_model_id);


--
-- Name: account_lock_exception_company_id_end_datetime_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_lock_exception_company_id_end_datetime_idx ON public.account_lock_exception USING btree (company_id, user_id, end_datetime) WHERE (active IS TRUE);


--
-- Name: INDEX account_lock_exception_company_id_end_datetime_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_lock_exception_company_id_end_datetime_idx IS 'INDEX (company_id, user_id, end_datetime) WHERE active IS TRUE';


--
-- Name: account_model_rel_account_account_id_account_transfer_model_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_model_rel_account_account_id_account_transfer_model_idx ON public.account_model_rel USING btree (account_account_id, account_transfer_model_id);


--
-- Name: account_move__account_payment_payment_id_invoice_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__account_payment_payment_id_invoice_id_idx ON public.account_move__account_payment USING btree (payment_id, invoice_id);


--
-- Name: account_move__auto_post_origin_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__auto_post_origin_id_index ON public.account_move USING btree (auto_post_origin_id) WHERE (auto_post_origin_id IS NOT NULL);


--
-- Name: account_move__campaign_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__campaign_id_index ON public.account_move USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


--
-- Name: account_move__closing_return_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__closing_return_id_index ON public.account_move USING btree (closing_return_id) WHERE (closing_return_id IS NOT NULL);


--
-- Name: account_move__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__company_id_index ON public.account_move USING btree (company_id);


--
-- Name: account_move__date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__date_index ON public.account_move USING btree (date);


--
-- Name: account_move__extract_attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__extract_attachment_id_index ON public.account_move USING btree (extract_attachment_id) WHERE (extract_attachment_id IS NOT NULL);


--
-- Name: account_move__inalterable_hash_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__inalterable_hash_index ON public.account_move USING btree (inalterable_hash) WHERE (inalterable_hash IS NOT NULL);


--
-- Name: account_move__invoice_date_due_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__invoice_date_due_index ON public.account_move USING btree (invoice_date_due);


--
-- Name: account_move__invoice_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__invoice_date_index ON public.account_move USING btree (invoice_date);


--
-- Name: account_move__medium_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__medium_id_index ON public.account_move USING btree (medium_id) WHERE (medium_id IS NOT NULL);


--
-- Name: account_move__message_main_attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__message_main_attachment_id_index ON public.account_move USING btree (message_main_attachment_id) WHERE (message_main_attachment_id IS NOT NULL);


--
-- Name: account_move__move_type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__move_type_index ON public.account_move USING btree (move_type);


--
-- Name: account_move__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__name_index ON public.account_move USING gin (public.unaccent((name)::text) public.gin_trgm_ops);


--
-- Name: account_move__origin_payment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__origin_payment_id_index ON public.account_move USING btree (origin_payment_id) WHERE (origin_payment_id IS NOT NULL);


--
-- Name: account_move__partner_bank_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__partner_bank_id_index ON public.account_move USING btree (partner_bank_id) WHERE (partner_bank_id IS NOT NULL);


--
-- Name: account_move__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__partner_id_index ON public.account_move USING btree (partner_id);


--
-- Name: account_move__payment_reference_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__payment_reference_index ON public.account_move USING gin (public.unaccent((payment_reference)::text) public.gin_trgm_ops);


--
-- Name: account_move__ref_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__ref_index ON public.account_move USING gin (public.unaccent((ref)::text) public.gin_trgm_ops);


--
-- Name: account_move__reversed_entry_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__reversed_entry_id_index ON public.account_move USING btree (reversed_entry_id) WHERE (reversed_entry_id IS NOT NULL);


--
-- Name: account_move__secure_sequence_number_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__secure_sequence_number_index ON public.account_move USING btree (secure_sequence_number);


--
-- Name: account_move__source_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__source_id_index ON public.account_move USING btree (source_id) WHERE (source_id IS NOT NULL);


--
-- Name: account_move__statement_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__statement_line_id_index ON public.account_move USING btree (statement_line_id) WHERE (statement_line_id IS NOT NULL);


--
-- Name: account_move__tax_cash_basis_origin_move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__tax_cash_basis_origin_move_id_index ON public.account_move USING btree (tax_cash_basis_origin_move_id) WHERE (tax_cash_basis_origin_move_id IS NOT NULL);


--
-- Name: account_move__tax_cash_basis_rec_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__tax_cash_basis_rec_id_index ON public.account_move USING btree (tax_cash_basis_rec_id) WHERE (tax_cash_basis_rec_id IS NOT NULL);


--
-- Name: account_move__transfer_model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move__transfer_model_id_index ON public.account_move USING btree (transfer_model_id) WHERE (transfer_model_id IS NOT NULL);


--
-- Name: account_move_account_move_sen_account_move_id_account_move__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_account_move_sen_account_move_id_account_move__idx ON public.account_move_account_move_send_batch_wizard_rel USING btree (account_move_id, account_move_send_batch_wizard_id);


--
-- Name: account_move_account_resequen_account_move_id_account_reseq_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_account_resequen_account_move_id_account_reseq_idx ON public.account_move_account_resequence_wizard_rel USING btree (account_move_id, account_resequence_wizard_id);


--
-- Name: account_move_checked_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_checked_idx ON public.account_move USING btree (journal_id) WHERE (checked IS NOT TRUE);


--
-- Name: INDEX account_move_checked_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_checked_idx IS 'INDEX (journal_id) WHERE (checked IS NOT TRUE)';


--
-- Name: account_move_deferred_rel_deferred_move_id_original_move_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_deferred_rel_deferred_move_id_original_move_id_idx ON public.account_move_deferred_rel USING btree (deferred_move_id, original_move_id);


--
-- Name: account_move_duplicate_bills_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_duplicate_bills_idx ON public.account_move USING btree (ref) WHERE ((move_type)::text = ANY (ARRAY[('in_invoice'::character varying)::text, ('in_refund'::character varying)::text]));


--
-- Name: INDEX account_move_duplicate_bills_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_duplicate_bills_idx IS 'INDEX (ref) WHERE (move_type IN (''in_invoice'', ''in_refund''))';


--
-- Name: account_move_journal_id_company_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_journal_id_company_id_idx ON public.account_move USING btree (journal_id, company_id, date);


--
-- Name: INDEX account_move_journal_id_company_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_journal_id_company_id_idx IS 'INDEX (journal_id, company_id, date)';


--
-- Name: account_move_line__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__company_id_index ON public.account_move_line USING btree (company_id);


--
-- Name: account_move_line__date_maturity_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__date_maturity_index ON public.account_move_line USING btree (date_maturity);


--
-- Name: account_move_line__deferred_end_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__deferred_end_date_index ON public.account_move_line USING btree (deferred_end_date) WHERE (deferred_end_date IS NOT NULL);


--
-- Name: account_move_line__deferred_start_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__deferred_start_date_index ON public.account_move_line USING btree (deferred_start_date) WHERE (deferred_start_date IS NOT NULL);


--
-- Name: account_move_line__full_reconcile_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__full_reconcile_id_index ON public.account_move_line USING btree (full_reconcile_id) WHERE (full_reconcile_id IS NOT NULL);


--
-- Name: account_move_line__group_tax_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__group_tax_id_index ON public.account_move_line USING btree (group_tax_id) WHERE (group_tax_id IS NOT NULL);


--
-- Name: account_move_line__journal_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__journal_id_index ON public.account_move_line USING btree (journal_id);


--
-- Name: account_move_line__matching_number_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__matching_number_index ON public.account_move_line USING btree (matching_number);


--
-- Name: account_move_line__move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__move_id_index ON public.account_move_line USING btree (move_id);


--
-- Name: account_move_line__move_name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__move_name_index ON public.account_move_line USING btree (move_name);


--
-- Name: account_move_line__payment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__payment_id_index ON public.account_move_line USING btree (payment_id) WHERE (payment_id IS NOT NULL);


--
-- Name: account_move_line__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__product_id_index ON public.account_move_line USING btree (product_id);


--
-- Name: account_move_line__ref_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__ref_index ON public.account_move_line USING gin (public.unaccent((ref)::text) public.gin_trgm_ops);


--
-- Name: account_move_line__statement_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__statement_id_index ON public.account_move_line USING btree (statement_id) WHERE (statement_id IS NOT NULL);


--
-- Name: account_move_line__statement_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line__statement_line_id_index ON public.account_move_line USING btree (statement_line_id) WHERE (statement_line_id IS NOT NULL);


--
-- Name: account_move_line_account_id_date_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_account_id_date_idx ON public.account_move_line USING btree (account_id, date);


--
-- Name: INDEX account_move_line_account_id_date_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_line_account_id_date_idx IS 'INDEX (account_id, date)';


--
-- Name: account_move_line_account_rec_account_move_line_id_account__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_account_rec_account_move_line_id_account__idx ON public.account_move_line_account_reconcile_wizard_rel USING btree (account_move_line_id, account_reconcile_wizard_id);


--
-- Name: account_move_line_account_tax_account_tax_id_account_move_l_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_account_tax_account_tax_id_account_move_l_idx ON public.account_move_line_account_tax_rel USING btree (account_tax_id, account_move_line_id);


--
-- Name: account_move_line_analytic_distribution_accounts_gin_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_analytic_distribution_accounts_gin_index ON public.account_move_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: account_move_line_date_name_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_date_name_id_idx ON public.account_move_line USING btree (date DESC, move_name DESC, id);


--
-- Name: INDEX account_move_line_date_name_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_line_date_name_id_idx IS 'INDEX (date desc, move_name desc, id)';


--
-- Name: account_move_line_journal_id_neg_amnt_residual_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_journal_id_neg_amnt_residual_idx ON public.account_move_line USING btree (journal_id) WHERE (amount_residual < (0)::numeric);


--
-- Name: INDEX account_move_line_journal_id_neg_amnt_residual_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_line_journal_id_neg_amnt_residual_idx IS 'INDEX (journal_id) WHERE amount_residual < 0';


--
-- Name: account_move_line_partner_id_ref_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_partner_id_ref_idx ON public.account_move_line USING btree (partner_id, ref);


--
-- Name: INDEX account_move_line_partner_id_ref_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_line_partner_id_ref_idx IS 'INDEX (partner_id, ref)';


--
-- Name: account_move_line_unreconciled_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_line_unreconciled_index ON public.account_move_line USING btree (account_id, partner_id) WHERE (reconciled IS NOT TRUE);


--
-- Name: INDEX account_move_line_unreconciled_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_line_unreconciled_index IS 'INDEX (account_id, partner_id) WHERE reconciled IS NOT TRUE';


--
-- Name: account_move_made_gaps; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_made_gaps ON public.account_move USING btree (journal_id, state, payment_state, move_type, date) WHERE (made_sequence_gap IS TRUE);


--
-- Name: INDEX account_move_made_gaps; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_made_gaps IS 'INDEX (journal_id, state, payment_state, move_type, date) WHERE (made_sequence_gap IS TRUE)';


--
-- Name: account_move_payment_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_payment_idx ON public.account_move USING btree (journal_id, state, payment_state, move_type, date);


--
-- Name: INDEX account_move_payment_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_payment_idx IS 'INDEX (journal_id, state, payment_state, move_type, date)';


--
-- Name: account_move_reversal_move_move_id_reversal_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_reversal_move_move_id_reversal_id_idx ON public.account_move_reversal_move USING btree (move_id, reversal_id);


--
-- Name: account_move_reversal_new_move_new_move_id_reversal_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_reversal_new_move_new_move_id_reversal_id_idx ON public.account_move_reversal_new_move USING btree (new_move_id, reversal_id);


--
-- Name: account_move_send_wizard_res__res_partner_id_account_move_s_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_send_wizard_res__res_partner_id_account_move_s_idx ON public.account_move_send_wizard_res_partner_rel USING btree (res_partner_id, account_move_send_wizard_id);


--
-- Name: account_move_sequence_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_sequence_index ON public.account_move USING btree (journal_id, sequence_prefix DESC, sequence_number DESC, name);


--
-- Name: account_move_sequence_index2; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_sequence_index2 ON public.account_move USING btree (journal_id, id DESC, sequence_prefix);


--
-- Name: account_move_unique_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX account_move_unique_name ON public.account_move USING btree (name, journal_id) WHERE (((state)::text = 'posted'::text) AND ((name)::text <> '/'::text));


--
-- Name: INDEX account_move_unique_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_move_unique_name IS 'UNIQUE INDEX (name, journal_id) WHERE (state = ''posted''AND name != ''/'')';


--
-- Name: account_move_validate_account_account_move_id_validate_acco_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_move_validate_account_account_move_id_validate_acco_idx ON public.account_move_validate_account_move_rel USING btree (account_move_id, validate_account_move_id);


--
-- Name: account_online_account__account_online_link_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_online_account__account_online_link_id_index ON public.account_online_account USING btree (account_online_link_id);


--
-- Name: account_partial_reconcile__credit_move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_partial_reconcile__credit_move_id_index ON public.account_partial_reconcile USING btree (credit_move_id);


--
-- Name: account_partial_reconcile__debit_move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_partial_reconcile__debit_move_id_index ON public.account_partial_reconcile USING btree (debit_move_id);


--
-- Name: account_partial_reconcile__exchange_move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_partial_reconcile__exchange_move_id_index ON public.account_partial_reconcile USING btree (exchange_move_id) WHERE (exchange_move_id IS NOT NULL);


--
-- Name: account_partial_reconcile__full_reconcile_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_partial_reconcile__full_reconcile_id_index ON public.account_partial_reconcile USING btree (full_reconcile_id) WHERE (full_reconcile_id IS NOT NULL);


--
-- Name: account_payment__message_main_attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment__message_main_attachment_id_index ON public.account_payment USING btree (message_main_attachment_id) WHERE (message_main_attachment_id IS NOT NULL);


--
-- Name: account_payment__move_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment__move_id_index ON public.account_payment USING btree (move_id);


--
-- Name: account_payment__outstanding_account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment__outstanding_account_id_index ON public.account_payment USING btree (outstanding_account_id) WHERE (outstanding_account_id IS NOT NULL);


--
-- Name: account_payment__paired_internal_transfer_payment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment__paired_internal_transfer_payment_id_index ON public.account_payment USING btree (paired_internal_transfer_payment_id) WHERE (paired_internal_transfer_payment_id IS NOT NULL);


--
-- Name: account_payment__source_payment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment__source_payment_id_index ON public.account_payment USING btree (source_payment_id) WHERE (source_payment_id IS NOT NULL);


--
-- Name: account_payment_account_bank__account_payment_id_account_ba_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_account_bank__account_payment_id_account_ba_idx ON public.account_payment_account_bank_statement_line_rel USING btree (account_payment_id, account_bank_statement_line_id);


--
-- Name: account_payment_journal_id_company_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_journal_id_company_id_idx ON public.account_payment USING btree (journal_id, company_id);


--
-- Name: INDEX account_payment_journal_id_company_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_payment_journal_id_company_id_idx IS 'INDEX (journal_id, company_id)';


--
-- Name: account_payment_method_line__journal_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_method_line__journal_id_index ON public.account_payment_method_line USING btree (journal_id) WHERE (journal_id IS NOT NULL);


--
-- Name: account_payment_register_move_line_rel_line_id_wizard_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_register_move_line_rel_line_id_wizard_id_idx ON public.account_payment_register_move_line_rel USING btree (line_id, wizard_id);


--
-- Name: account_payment_term_line__payment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_term_line__payment_id_index ON public.account_payment_term_line USING btree (payment_id);


--
-- Name: account_payment_unmatched_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_payment_unmatched_idx ON public.account_payment USING btree (journal_id, company_id) WHERE (is_matched IS NOT TRUE);


--
-- Name: INDEX account_payment_unmatched_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.account_payment_unmatched_idx IS 'INDEX (journal_id, company_id) WHERE is_matched IS NOT TRUE';


--
-- Name: account_reconcile_model_line__account_tax_id_account_reconc_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_reconcile_model_line__account_tax_id_account_reconc_idx ON public.account_reconcile_model_line_account_tax_rel USING btree (account_tax_id, account_reconcile_model_line_id);


--
-- Name: account_reconcile_model_line__model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_reconcile_model_line__model_id_index ON public.account_reconcile_model_line USING btree (model_id) WHERE (model_id IS NOT NULL);


--
-- Name: account_reconcile_model_line_analytic_distribution_accounts_gin; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_reconcile_model_line_analytic_distribution_accounts_gin ON public.account_reconcile_model_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: account_reconcile_model_res_p_res_partner_id_account_reconc_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_reconcile_model_res_p_res_partner_id_account_reconc_idx ON public.account_reconcile_model_res_partner_rel USING btree (res_partner_id, account_reconcile_model_id);


--
-- Name: account_report__root_report_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report__root_report_id_index ON public.account_report USING btree (root_report_id) WHERE (root_report_id IS NOT NULL);


--
-- Name: account_report_account_report_account_report_horizontal_gro_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_account_report_account_report_horizontal_gro_idx ON public.account_report_account_report_horizontal_group_rel USING btree (account_report_horizontal_group_id, account_report_id);


--
-- Name: account_report_annotation__line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_annotation__line_id_index ON public.account_report_annotation USING btree (line_id);


--
-- Name: account_report_annotation__report_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_annotation__report_id_index ON public.account_report_annotation USING btree (report_id) WHERE (report_id IS NOT NULL);


--
-- Name: account_report_budget_item__account_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_budget_item__account_id_index ON public.account_report_budget_item USING btree (account_id);


--
-- Name: account_report_budget_item__budget_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_budget_item__budget_id_index ON public.account_report_budget_item USING btree (budget_id);


--
-- Name: account_report_column__report_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_column__report_id_index ON public.account_report_column USING btree (report_id) WHERE (report_id IS NOT NULL);


--
-- Name: account_report_expression__report_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_expression__report_line_id_index ON public.account_report_expression USING btree (report_line_id);


--
-- Name: account_report_horizontal_group_rule__horizontal_group_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_horizontal_group_rule__horizontal_group_id_index ON public.account_report_horizontal_group_rule USING btree (horizontal_group_id);


--
-- Name: account_report_line__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_line__parent_id_index ON public.account_report_line USING btree (parent_id) WHERE (parent_id IS NOT NULL);


--
-- Name: account_report_line__report_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_line__report_id_index ON public.account_report_line USING btree (report_id);


--
-- Name: account_report_section_rel_sub_report_id_main_report_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_section_rel_sub_report_id_main_report_id_idx ON public.account_report_section_rel USING btree (sub_report_id, main_report_id);


--
-- Name: account_report_send_res_partn_res_partner_id_account_report_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_report_send_res_partn_res_partner_id_account_report_idx ON public.account_report_send_res_partner_rel USING btree (res_partner_id, account_report_send_id);


--
-- Name: account_return__message_main_attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return__message_main_attachment_id_index ON public.account_return USING btree (message_main_attachment_id) WHERE (message_main_attachment_id IS NOT NULL);


--
-- Name: account_return_check__return_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return_check__return_id_index ON public.account_return_check USING btree (return_id);


--
-- Name: account_return_check_res_user_res_users_id_account_return_c_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return_check_res_user_res_users_id_account_return_c_idx ON public.account_return_check_res_users_rel USING btree (res_users_id, account_return_check_id);


--
-- Name: account_return_ir_attachment__ir_attachment_id_account_retu_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return_ir_attachment__ir_attachment_id_account_retu_idx ON public.account_return_ir_attachment_rel USING btree (ir_attachment_id, account_return_id);


--
-- Name: account_return_res_company_re_res_company_id_account_return_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return_res_company_re_res_company_id_account_return_idx ON public.account_return_res_company_rel USING btree (res_company_id, account_return_id);


--
-- Name: account_return_type__report_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_return_type__report_id_index ON public.account_return_type USING btree (report_id);


--
-- Name: account_tax_alternatives_src_tax_id_dest_tax_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_tax_alternatives_src_tax_id_dest_tax_id_idx ON public.account_tax_alternatives USING btree (src_tax_id, dest_tax_id);


--
-- Name: account_tax_filiation_rel_child_tax_parent_tax_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_tax_filiation_rel_child_tax_parent_tax_idx ON public.account_tax_filiation_rel USING btree (child_tax, parent_tax);


--
-- Name: account_tax_repartition_line__tax_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_tax_repartition_line__tax_id_index ON public.account_tax_repartition_line USING btree (tax_id) WHERE (tax_id IS NOT NULL);


--
-- Name: account_tax_sale_order_line_r_account_tax_id_sale_order_lin_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_tax_sale_order_line_r_account_tax_id_sale_order_lin_idx ON public.account_tax_sale_order_line_rel USING btree (account_tax_id, sale_order_line_id);


--
-- Name: account_tax_unit_res_company__account_tax_unit_id_res_compa_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_tax_unit_res_company__account_tax_unit_id_res_compa_idx ON public.account_tax_unit_res_company_rel USING btree (account_tax_unit_id, res_company_id);


--
-- Name: account_transfer_model_line__transfer_model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_transfer_model_line__transfer_model_id_index ON public.account_transfer_model_line USING btree (transfer_model_id);


--
-- Name: account_transfer_model_line_r_res_partner_id_account_transf_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX account_transfer_model_line_r_res_partner_id_account_transf_idx ON public.account_transfer_model_line_res_partner_rel USING btree (res_partner_id, account_transfer_model_line_id);


--
-- Name: activity_attachment_rel_attachment_id_activity_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX activity_attachment_rel_attachment_id_activity_id_idx ON public.activity_attachment_rel USING btree (attachment_id, activity_id);


--
-- Name: adjusting_entries__account_mo_adjusting_entry_move_id_move__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX adjusting_entries__account_mo_adjusting_entry_move_id_move__idx ON public.adjusting_entries__account_move USING btree (adjusting_entry_move_id, move_id);


--
-- Name: auth_totp_device_user_id_index_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX auth_totp_device_user_id_index_idx ON public.auth_totp_device USING btree (user_id, index);


--
-- Name: auth_totp_rate_limit_log_user_id_limit_type_create_date_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX auth_totp_rate_limit_log_user_id_limit_type_create_date_idx ON public.auth_totp_rate_limit_log USING btree (user_id, limit_type, create_date);


--
-- Name: INDEX auth_totp_rate_limit_log_user_id_limit_type_create_date_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.auth_totp_rate_limit_log_user_id_limit_type_create_date_idx IS 'INDEX (user_id, limit_type, create_date)';


--
-- Name: barcode_rule__barcode_nomenclature_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX barcode_rule__barcode_nomenclature_id_index ON public.barcode_rule USING btree (barcode_nomenclature_id) WHERE (barcode_nomenclature_id IS NOT NULL);


--
-- Name: base_import_mapping__res_model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX base_import_mapping__res_model_index ON public.base_import_mapping USING btree (res_model);


--
-- Name: base_language_install_website_website_id_base_language_inst_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX base_language_install_website_website_id_base_language_inst_idx ON public.base_language_install_website_rel USING btree (website_id, base_language_install_id);


--
-- Name: base_module_uninstall_ir_modu_ir_module_module_id_base_modu_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX base_module_uninstall_ir_modu_ir_module_module_id_base_modu_idx ON public.base_module_uninstall_ir_module_module_rel USING btree (ir_module_module_id, base_module_uninstall_id);


--
-- Name: base_partner_merge_automatic__res_partner_id_base_partner_m_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX base_partner_merge_automatic__res_partner_id_base_partner_m_idx ON public.base_partner_merge_automatic_wizard_res_partner_rel USING btree (res_partner_id, base_partner_merge_automatic_wizard_id);


--
-- Name: blog_blog__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_blog__website_id_index ON public.blog_blog USING btree (website_id);


--
-- Name: blog_post__author_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_post__author_id_index ON public.blog_post USING btree (author_id) WHERE (author_id IS NOT NULL);


--
-- Name: blog_post__blog_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_post__blog_id_index ON public.blog_post USING btree (blog_id);


--
-- Name: blog_post__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_post__is_published_index ON public.blog_post USING btree (is_published);


--
-- Name: blog_post__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_post__website_id_index ON public.blog_post USING btree (website_id);


--
-- Name: blog_post_blog_tag_rel_blog_post_id_blog_tag_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_post_blog_tag_rel_blog_post_id_blog_tag_id_idx ON public.blog_post_blog_tag_rel USING btree (blog_post_id, blog_tag_id);


--
-- Name: blog_tag__category_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX blog_tag__category_id_index ON public.blog_tag USING btree (category_id);


--
-- Name: crm_team__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX crm_team__company_id_index ON public.crm_team USING btree (company_id);


--
-- Name: crm_team_member__crm_team_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX crm_team_member__crm_team_id_index ON public.crm_team_member USING btree (crm_team_id);


--
-- Name: crm_team_member__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX crm_team_member__user_id_index ON public.crm_team_member USING btree (user_id);


--
-- Name: delivery_carrier__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_carrier__is_published_index ON public.delivery_carrier USING btree (is_published);


--
-- Name: delivery_carrier__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_carrier__website_id_index ON public.delivery_carrier USING btree (website_id);


--
-- Name: delivery_carrier_country_rel_country_id_carrier_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_carrier_country_rel_country_id_carrier_id_idx ON public.delivery_carrier_country_rel USING btree (country_id, carrier_id);


--
-- Name: delivery_carrier_state_rel_state_id_carrier_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_carrier_state_rel_state_id_carrier_id_idx ON public.delivery_carrier_state_rel USING btree (state_id, carrier_id);


--
-- Name: delivery_price_rule__carrier_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_price_rule__carrier_id_index ON public.delivery_price_rule USING btree (carrier_id);


--
-- Name: delivery_zip_prefix_rel_zip_prefix_id_carrier_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX delivery_zip_prefix_rel_zip_prefix_id_carrier_id_idx ON public.delivery_zip_prefix_rel USING btree (zip_prefix_id, carrier_id);


--
-- Name: digest_digest_res_users_rel_res_users_id_digest_digest_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX digest_digest_res_users_rel_res_users_id_digest_digest_id_idx ON public.digest_digest_res_users_rel USING btree (res_users_id, digest_digest_id);


--
-- Name: digest_tip_res_users_rel_res_users_id_digest_tip_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX digest_tip_res_users_rel_res_users_id_digest_tip_id_idx ON public.digest_tip_res_users_rel USING btree (res_users_id, digest_tip_id);


--
-- Name: discuss_call_history__channel_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_call_history__channel_id_index ON public.discuss_call_history USING btree (channel_id);


--
-- Name: discuss_call_history__start_call_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_call_history__start_call_message_id_index ON public.discuss_call_history USING btree (start_call_message_id);


--
-- Name: discuss_call_history__start_dt_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_call_history__start_dt_index ON public.discuss_call_history USING btree (start_dt);


--
-- Name: discuss_call_history_channel_id_end_dt_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_call_history_channel_id_end_dt_idx ON public.discuss_call_history USING btree (channel_id, end_dt) WHERE (end_dt IS NULL);


--
-- Name: INDEX discuss_call_history_channel_id_end_dt_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.discuss_call_history_channel_id_end_dt_idx IS 'INDEX (channel_id, end_dt) WHERE end_dt IS NULL';


--
-- Name: discuss_channel__last_interest_dt_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel__last_interest_dt_index ON public.discuss_channel USING btree (last_interest_dt);


--
-- Name: discuss_channel__parent_channel_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel__parent_channel_id_index ON public.discuss_channel USING btree (parent_channel_id);


--
-- Name: discuss_channel_member__fetched_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__fetched_message_id_index ON public.discuss_channel_member USING btree (fetched_message_id) WHERE (fetched_message_id IS NOT NULL);


--
-- Name: discuss_channel_member__guest_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__guest_id_index ON public.discuss_channel_member USING btree (guest_id);


--
-- Name: discuss_channel_member__last_interest_dt_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__last_interest_dt_index ON public.discuss_channel_member USING btree (last_interest_dt);


--
-- Name: discuss_channel_member__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__partner_id_index ON public.discuss_channel_member USING btree (partner_id);


--
-- Name: discuss_channel_member__seen_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__seen_message_id_index ON public.discuss_channel_member USING btree (seen_message_id) WHERE (seen_message_id IS NOT NULL);


--
-- Name: discuss_channel_member__unpin_dt_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member__unpin_dt_index ON public.discuss_channel_member USING btree (unpin_dt);


--
-- Name: discuss_channel_member_guest_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX discuss_channel_member_guest_unique ON public.discuss_channel_member USING btree (channel_id, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: INDEX discuss_channel_member_guest_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.discuss_channel_member_guest_unique IS 'UNIQUE INDEX (channel_id, guest_id) WHERE guest_id IS NOT NULL';


--
-- Name: discuss_channel_member_partner_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX discuss_channel_member_partner_unique ON public.discuss_channel_member USING btree (channel_id, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: INDEX discuss_channel_member_partner_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.discuss_channel_member_partner_unique IS 'UNIQUE INDEX (channel_id, partner_id) WHERE partner_id IS NOT NULL';


--
-- Name: discuss_channel_member_seen_message_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_member_seen_message_id_idx ON public.discuss_channel_member USING btree (channel_id, partner_id, seen_message_id);


--
-- Name: INDEX discuss_channel_member_seen_message_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.discuss_channel_member_seen_message_id_idx IS 'INDEX (channel_id, partner_id, seen_message_id)';


--
-- Name: discuss_channel_res_groups_re_res_groups_id_discuss_channel_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_res_groups_re_res_groups_id_discuss_channel_idx ON public.discuss_channel_res_groups_rel USING btree (res_groups_id, discuss_channel_id);


--
-- Name: discuss_channel_rtc_session__channel_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_rtc_session__channel_id_index ON public.discuss_channel_rtc_session USING btree (channel_id) WHERE (channel_id IS NOT NULL);


--
-- Name: discuss_channel_rtc_session__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_rtc_session__partner_id_index ON public.discuss_channel_rtc_session USING btree (partner_id);


--
-- Name: discuss_channel_rtc_session__write_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_channel_rtc_session__write_date_index ON public.discuss_channel_rtc_session USING btree (write_date);


--
-- Name: discuss_voice_metadata__attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX discuss_voice_metadata__attachment_id_index ON public.discuss_voice_metadata USING btree (attachment_id);


--
-- Name: dms_acc_rep_export_wizard_for_account_reports_export_wizard_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dms_acc_rep_export_wizard_for_account_reports_export_wizard_idx ON public.dms_acc_rep_export_wizard_format_rel USING btree (account_reports_export_wizard_format_id, account_reports_export_wizard_id);


--
-- Name: email_template_attachment_rel_attachment_id_email_template__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX email_template_attachment_rel_attachment_id_email_template__idx ON public.email_template_attachment_rel USING btree (attachment_id, email_template_id);


--
-- Name: event_event__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_event__is_published_index ON public.event_event USING btree (is_published);


--
-- Name: event_event__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_event__website_id_index ON public.event_event USING btree (website_id);


--
-- Name: event_event_event_tag_rel_event_tag_id_event_event_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_event_event_tag_rel_event_tag_id_event_event_id_idx ON public.event_event_event_tag_rel USING btree (event_tag_id, event_event_id);


--
-- Name: event_event_ticket__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_event_ticket__event_id_index ON public.event_event_ticket USING btree (event_id);


--
-- Name: event_event_ticket__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_event_ticket__product_id_index ON public.event_event_ticket USING btree (product_id);


--
-- Name: event_mail__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_mail__event_id_index ON public.event_mail USING btree (event_id);


--
-- Name: event_mail_registration__registration_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_mail_registration__registration_id_index ON public.event_mail_registration USING btree (registration_id);


--
-- Name: event_mail_registration__scheduler_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_mail_registration__scheduler_id_index ON public.event_mail_registration USING btree (scheduler_id);


--
-- Name: event_mail_slot__scheduler_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_mail_slot__scheduler_id_index ON public.event_mail_slot USING btree (scheduler_id);


--
-- Name: event_question__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_question__event_id_index ON public.event_question USING btree (event_id) WHERE (event_id IS NOT NULL);


--
-- Name: event_question__event_type_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_question__event_type_id_index ON public.event_question USING btree (event_type_id) WHERE (event_type_id IS NOT NULL);


--
-- Name: event_question_answer__question_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_question_answer__question_id_index ON public.event_question_answer USING btree (question_id);


--
-- Name: event_registration__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__event_id_index ON public.event_registration USING btree (event_id);


--
-- Name: event_registration__event_slot_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__event_slot_id_index ON public.event_registration USING btree (event_slot_id) WHERE (event_slot_id IS NOT NULL);


--
-- Name: event_registration__event_ticket_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__event_ticket_id_index ON public.event_registration USING btree (event_ticket_id) WHERE (event_ticket_id IS NOT NULL);


--
-- Name: event_registration__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__name_index ON public.event_registration USING gin (public.unaccent((name)::text) public.gin_trgm_ops);


--
-- Name: event_registration__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__partner_id_index ON public.event_registration USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: event_registration__sale_order_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__sale_order_line_id_index ON public.event_registration USING btree (sale_order_line_id) WHERE (sale_order_line_id IS NOT NULL);


--
-- Name: event_registration__utm_campaign_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__utm_campaign_id_index ON public.event_registration USING btree (utm_campaign_id);


--
-- Name: event_registration__utm_medium_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__utm_medium_id_index ON public.event_registration USING btree (utm_medium_id);


--
-- Name: event_registration__utm_source_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__utm_source_id_index ON public.event_registration USING btree (utm_source_id);


--
-- Name: event_registration__visitor_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration__visitor_id_index ON public.event_registration USING btree (visitor_id) WHERE (visitor_id IS NOT NULL);


--
-- Name: event_registration_answer__registration_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_registration_answer__registration_id_index ON public.event_registration_answer USING btree (registration_id);


--
-- Name: event_slot__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_slot__event_id_index ON public.event_slot USING btree (event_id);


--
-- Name: event_tag__category_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag__category_id_index ON public.event_tag USING btree (category_id);


--
-- Name: event_tag__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag__is_published_index ON public.event_tag USING btree (is_published);


--
-- Name: event_tag__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag__website_id_index ON public.event_tag USING btree (website_id);


--
-- Name: event_tag_category__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag_category__is_published_index ON public.event_tag_category USING btree (is_published);


--
-- Name: event_tag_category__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag_category__website_id_index ON public.event_tag_category USING btree (website_id);


--
-- Name: event_tag_event_type_rel_event_tag_id_event_type_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_tag_event_type_rel_event_tag_id_event_type_id_idx ON public.event_tag_event_type_rel USING btree (event_tag_id, event_type_id);


--
-- Name: event_type_ticket__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX event_type_ticket__product_id_index ON public.event_type_ticket USING btree (product_id);


--
-- Name: fetchmail_server__server_type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fetchmail_server__server_type_index ON public.fetchmail_server USING btree (server_type);


--
-- Name: fetchmail_server__state_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fetchmail_server__state_index ON public.fetchmail_server USING btree (state);


--
-- Name: header_footer_quotation_templ_sale_order_template_id_quotat_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX header_footer_quotation_templ_sale_order_template_id_quotat_idx ON public.header_footer_quotation_template_rel USING btree (sale_order_template_id, quotation_document_id);


--
-- Name: iap_account_res_company_rel_res_company_id_iap_account_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX iap_account_res_company_rel_res_company_id_iap_account_id_idx ON public.iap_account_res_company_rel USING btree (res_company_id, iap_account_id);


--
-- Name: iap_account_res_users_rel_res_users_id_iap_account_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX iap_account_res_users_rel_res_users_id_iap_account_id_idx ON public.iap_account_res_users_rel USING btree (res_users_id, iap_account_id);


--
-- Name: iap_extracted_words_res_id_res_model_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX iap_extracted_words_res_id_res_model_idx ON public.iap_extracted_words USING btree (res_id, res_model);


--
-- Name: INDEX iap_extracted_words_res_id_res_model_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.iap_extracted_words_res_id_res_model_idx IS 'INDEX (res_id, res_model)';


--
-- Name: ir_act_report_xml__paperformat_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_report_xml__paperformat_id_index ON public.ir_act_report_xml USING btree (paperformat_id) WHERE (paperformat_id IS NOT NULL);


--
-- Name: ir_act_server__model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_server__model_id_index ON public.ir_act_server USING btree (model_id);


--
-- Name: ir_act_server__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_server__parent_id_index ON public.ir_act_server USING btree (parent_id);


--
-- Name: ir_act_server_group_rel_gid_act_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_server_group_rel_gid_act_id_idx ON public.ir_act_server_group_rel USING btree (gid, act_id);


--
-- Name: ir_act_server_res_partner_rel_res_partner_id_ir_act_server__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_server_res_partner_rel_res_partner_id_ir_act_server__idx ON public.ir_act_server_res_partner_rel USING btree (res_partner_id, ir_act_server_id);


--
-- Name: ir_act_server_webhook_field_rel_field_id_server_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_server_webhook_field_rel_field_id_server_id_idx ON public.ir_act_server_webhook_field_rel USING btree (field_id, server_id);


--
-- Name: ir_act_window_group_rel_gid_act_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_window_group_rel_gid_act_id_idx ON public.ir_act_window_group_rel USING btree (gid, act_id);


--
-- Name: ir_act_window_view__act_window_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_act_window_view__act_window_id_index ON public.ir_act_window_view USING btree (act_window_id) WHERE (act_window_id IS NOT NULL);


--
-- Name: ir_act_window_view_unique_mode_per_action; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX ir_act_window_view_unique_mode_per_action ON public.ir_act_window_view USING btree (act_window_id, view_mode);


--
-- Name: INDEX ir_act_window_view_unique_mode_per_action; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_act_window_view_unique_mode_per_action IS 'UNIQUE INDEX (act_window_id, view_mode)';


--
-- Name: ir_actions_todo__action_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_actions_todo__action_id_index ON public.ir_actions_todo USING btree (action_id);


--
-- Name: ir_asset__theme_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_asset__theme_template_id_index ON public.ir_asset USING btree (theme_template_id) WHERE (theme_template_id IS NOT NULL);


--
-- Name: ir_attachment__original_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_attachment__original_id_index ON public.ir_attachment USING btree (original_id) WHERE (original_id IS NOT NULL);


--
-- Name: ir_attachment__store_fname_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_attachment__store_fname_index ON public.ir_attachment USING btree (store_fname);


--
-- Name: ir_attachment__theme_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_attachment__theme_template_id_index ON public.ir_attachment USING btree (theme_template_id) WHERE (theme_template_id IS NOT NULL);


--
-- Name: ir_attachment__url_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_attachment__url_index ON public.ir_attachment USING btree (url) WHERE (url IS NOT NULL);


--
-- Name: ir_attachment_res_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_attachment_res_idx ON public.ir_attachment USING btree (res_model, res_id);


--
-- Name: INDEX ir_attachment_res_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_attachment_res_idx IS 'INDEX (res_model, res_id)';


--
-- Name: ir_cron__ir_actions_server_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_cron__ir_actions_server_id_index ON public.ir_cron USING btree (ir_actions_server_id);


--
-- Name: ir_cron_progress__cron_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_cron_progress__cron_id_index ON public.ir_cron_progress USING btree (cron_id);


--
-- Name: ir_cron_trigger__call_at_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_cron_trigger__call_at_index ON public.ir_cron_trigger USING btree (call_at);


--
-- Name: ir_cron_trigger__cron_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_cron_trigger__cron_id_index ON public.ir_cron_trigger USING btree (cron_id);


--
-- Name: ir_default__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_default__company_id_index ON public.ir_default USING btree (company_id);


--
-- Name: ir_default__field_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_default__field_id_index ON public.ir_default USING btree (field_id);


--
-- Name: ir_default__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_default__user_id_index ON public.ir_default USING btree (user_id);


--
-- Name: ir_embedded_actions_res_group_res_groups_id_ir_embedded_act_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_embedded_actions_res_group_res_groups_id_ir_embedded_act_idx ON public.ir_embedded_actions_res_groups_rel USING btree (res_groups_id, ir_embedded_actions_id);


--
-- Name: ir_exports__resource_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_exports__resource_index ON public.ir_exports USING btree (resource);


--
-- Name: ir_exports_line__export_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_exports_line__export_id_index ON public.ir_exports_line USING btree (export_id);


--
-- Name: ir_filters__embedded_action_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_filters__embedded_action_id_index ON public.ir_filters USING btree (embedded_action_id) WHERE (embedded_action_id IS NOT NULL);


--
-- Name: ir_filters_get_filters_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_filters_get_filters_index ON public.ir_filters USING btree (model_id, action_id, embedded_action_id, embedded_parent_res_id);


--
-- Name: INDEX ir_filters_get_filters_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_filters_get_filters_index IS 'INDEX (model_id, action_id, embedded_action_id, embedded_parent_res_id)';


--
-- Name: ir_filters_res_users_rel_res_users_id_ir_filters_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_filters_res_users_rel_res_users_id_ir_filters_id_idx ON public.ir_filters_res_users_rel USING btree (res_users_id, ir_filters_id);


--
-- Name: ir_logging__dbname_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_logging__dbname_index ON public.ir_logging USING btree (dbname);


--
-- Name: ir_logging__level_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_logging__level_index ON public.ir_logging USING btree (level);


--
-- Name: ir_logging__type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_logging__type_index ON public.ir_logging USING btree (type);


--
-- Name: ir_mail_server__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_mail_server__name_index ON public.ir_mail_server USING btree (name);


--
-- Name: ir_model_access__group_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_access__group_id_index ON public.ir_model_access USING btree (group_id);


--
-- Name: ir_model_access__model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_access__model_id_index ON public.ir_model_access USING btree (model_id);


--
-- Name: ir_model_access__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_access__name_index ON public.ir_model_access USING btree (name);


--
-- Name: ir_model_constraint__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_constraint__model_index ON public.ir_model_constraint USING btree (model);


--
-- Name: ir_model_constraint__module_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_constraint__module_index ON public.ir_model_constraint USING btree (module);


--
-- Name: ir_model_constraint__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_constraint__name_index ON public.ir_model_constraint USING btree (name);


--
-- Name: ir_model_constraint__type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_constraint__type_index ON public.ir_model_constraint USING btree (type);


--
-- Name: ir_model_data_model_res_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_data_model_res_id_index ON public.ir_model_data USING btree (model, res_id);


--
-- Name: INDEX ir_model_data_model_res_id_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_model_data_model_res_id_index IS 'INDEX (model, res_id)';


--
-- Name: ir_model_data_module_name_uniq_index; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX ir_model_data_module_name_uniq_index ON public.ir_model_data USING btree (module, name);


--
-- Name: INDEX ir_model_data_module_name_uniq_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_model_data_module_name_uniq_index IS 'UNIQUE INDEX (module, name)';


--
-- Name: ir_model_fields__complete_name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__complete_name_index ON public.ir_model_fields USING btree (complete_name);


--
-- Name: ir_model_fields__model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__model_id_index ON public.ir_model_fields USING btree (model_id);


--
-- Name: ir_model_fields__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__model_index ON public.ir_model_fields USING btree (model);


--
-- Name: ir_model_fields__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__name_index ON public.ir_model_fields USING btree (name);


--
-- Name: ir_model_fields__state_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__state_index ON public.ir_model_fields USING btree (state);


--
-- Name: ir_model_fields__website_form_blacklisted_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields__website_form_blacklisted_index ON public.ir_model_fields USING btree (website_form_blacklisted);


--
-- Name: ir_model_fields_group_rel_group_id_field_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields_group_rel_group_id_field_id_idx ON public.ir_model_fields_group_rel USING btree (group_id, field_id);


--
-- Name: ir_model_fields_selection__field_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_fields_selection__field_id_index ON public.ir_model_fields_selection USING btree (field_id);


--
-- Name: ir_model_relation__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_relation__model_index ON public.ir_model_relation USING btree (model);


--
-- Name: ir_model_relation__module_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_relation__module_index ON public.ir_model_relation USING btree (module);


--
-- Name: ir_model_relation__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_relation__name_index ON public.ir_model_relation USING btree (name);


--
-- Name: ir_model_spreadsheet_dashboar_ir_model_id_spreadsheet_dashb_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_model_spreadsheet_dashboar_ir_model_id_spreadsheet_dashb_idx ON public.ir_model_spreadsheet_dashboard_rel USING btree (ir_model_id, spreadsheet_dashboard_id);


--
-- Name: ir_module_category__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_module_category__parent_id_index ON public.ir_module_category USING btree (parent_id);


--
-- Name: ir_module_module__category_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_module_module__category_id_index ON public.ir_module_module USING btree (category_id);


--
-- Name: ir_module_module__state_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_module_module__state_index ON public.ir_module_module USING btree (state);


--
-- Name: ir_module_module_dependency__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_module_module_dependency__name_index ON public.ir_module_module_dependency USING btree (name);


--
-- Name: ir_module_module_exclusion__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_module_module_exclusion__name_index ON public.ir_module_module_exclusion USING btree (name);


--
-- Name: ir_profile__session_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_profile__session_index ON public.ir_profile USING btree (session);


--
-- Name: ir_rule__model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_rule__model_id_index ON public.ir_rule USING btree (model_id);


--
-- Name: ir_rule__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_rule__name_index ON public.ir_rule USING btree (name);


--
-- Name: ir_ui_menu__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_menu__parent_id_index ON public.ir_ui_menu USING btree (parent_id);


--
-- Name: ir_ui_menu__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_menu__parent_path_index ON public.ir_ui_menu USING btree (parent_path);


--
-- Name: ir_ui_menu_group_rel_gid_menu_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_menu_group_rel_gid_menu_id_idx ON public.ir_ui_menu_group_rel USING btree (gid, menu_id);


--
-- Name: ir_ui_view__inherit_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view__inherit_id_index ON public.ir_ui_view USING btree (inherit_id);


--
-- Name: ir_ui_view__key_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view__key_index ON public.ir_ui_view USING btree (key) WHERE (key IS NOT NULL);


--
-- Name: ir_ui_view__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view__model_index ON public.ir_ui_view USING btree (model);


--
-- Name: ir_ui_view__theme_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view__theme_template_id_index ON public.ir_ui_view USING btree (theme_template_id) WHERE (theme_template_id IS NOT NULL);


--
-- Name: ir_ui_view_custom__ref_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view_custom__ref_id_index ON public.ir_ui_view_custom USING btree (ref_id);


--
-- Name: ir_ui_view_custom__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view_custom__user_id_index ON public.ir_ui_view_custom USING btree (user_id);


--
-- Name: ir_ui_view_custom_user_id_ref_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view_custom_user_id_ref_id ON public.ir_ui_view_custom USING btree (user_id, ref_id);


--
-- Name: INDEX ir_ui_view_custom_user_id_ref_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_ui_view_custom_user_id_ref_id IS 'INDEX (user_id, ref_id)';


--
-- Name: ir_ui_view_group_rel_group_id_view_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view_group_rel_group_id_view_id_idx ON public.ir_ui_view_group_rel USING btree (group_id, view_id);


--
-- Name: ir_ui_view_model_type_inherit_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ir_ui_view_model_type_inherit_id ON public.ir_ui_view USING btree (model, inherit_id);


--
-- Name: INDEX ir_ui_view_model_type_inherit_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.ir_ui_view_model_type_inherit_id IS 'INDEX (model, inherit_id)';


--
-- Name: mail_activity__date_deadline_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity__date_deadline_index ON public.mail_activity USING btree (date_deadline);


--
-- Name: mail_activity__res_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity__res_id_index ON public.mail_activity USING btree (res_id);


--
-- Name: mail_activity__res_model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity__res_model_id_index ON public.mail_activity USING btree (res_model_id);


--
-- Name: mail_activity__res_model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity__res_model_index ON public.mail_activity USING btree (res_model);


--
-- Name: mail_activity__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity__user_id_index ON public.mail_activity USING btree (user_id);


--
-- Name: mail_activity_plan_mail_activ_mail_activity_plan_id_mail_ac_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_plan_mail_activ_mail_activity_plan_id_mail_ac_idx ON public.mail_activity_plan_mail_activity_schedule_rel USING btree (mail_activity_plan_id, mail_activity_schedule_id);


--
-- Name: mail_activity_plan_template__plan_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_plan_template__plan_id_index ON public.mail_activity_plan_template USING btree (plan_id);


--
-- Name: mail_activity_plan_template_m_mail_activity_type_id_mail_ac_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_plan_template_m_mail_activity_type_id_mail_ac_idx ON public.mail_activity_plan_template_mail_activity_type_rel USING btree (mail_activity_type_id, mail_activity_plan_template_id);


--
-- Name: mail_activity_rel_recommended_id_activity_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_rel_recommended_id_activity_id_idx ON public.mail_activity_rel USING btree (recommended_id, activity_id);


--
-- Name: mail_activity_type__create_uid_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_type__create_uid_index ON public.mail_activity_type USING btree (create_uid);


--
-- Name: mail_activity_type_mail_templ_mail_template_id_mail_activit_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_activity_type_mail_templ_mail_template_id_mail_activit_idx ON public.mail_activity_type_mail_template_rel USING btree (mail_template_id, mail_activity_type_id);


--
-- Name: mail_alias__alias_full_name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_alias__alias_full_name_index ON public.mail_alias USING btree (alias_full_name) WHERE (alias_full_name IS NOT NULL);


--
-- Name: mail_alias_name_domain_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_alias_name_domain_unique ON public.mail_alias USING btree (alias_name, COALESCE(alias_domain_id, 0));


--
-- Name: INDEX mail_alias_name_domain_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_alias_name_domain_unique IS 'UNIQUE INDEX (alias_name, COALESCE(alias_domain_id, 0))';


--
-- Name: mail_blacklist__email_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_blacklist__email_index ON public.mail_blacklist USING gin (public.unaccent((email)::text) public.gin_trgm_ops);


--
-- Name: mail_canned_response__source_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_canned_response__source_index ON public.mail_canned_response USING gin (public.unaccent((source)::text) public.gin_trgm_ops);


--
-- Name: mail_canned_response_res_grou_res_groups_id_mail_canned_res_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_canned_response_res_grou_res_groups_id_mail_canned_res_idx ON public.mail_canned_response_res_groups_rel USING btree (res_groups_id, mail_canned_response_id);


--
-- Name: mail_compose_message_ir_attachments_attachment_id_wizard_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_compose_message_ir_attachments_attachment_id_wizard_id_idx ON public.mail_compose_message_ir_attachments_rel USING btree (attachment_id, wizard_id);


--
-- Name: mail_compose_message_res_partner_rel_partner_id_wizard_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_compose_message_res_partner_rel_partner_id_wizard_id_idx ON public.mail_compose_message_res_partner_rel USING btree (partner_id, wizard_id);


--
-- Name: mail_followers__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_followers__partner_id_index ON public.mail_followers USING btree (partner_id);


--
-- Name: mail_followers__res_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_followers__res_id_index ON public.mail_followers USING btree (res_id);


--
-- Name: mail_followers__res_model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_followers__res_model_index ON public.mail_followers USING btree (res_model);


--
-- Name: mail_followers_edit_res_partn_res_partner_id_mail_followers_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_followers_edit_res_partn_res_partner_id_mail_followers_idx ON public.mail_followers_edit_res_partner_rel USING btree (res_partner_id, mail_followers_edit_id);


--
-- Name: mail_followers_mail_message_s_mail_message_subtype_id_mail__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_followers_mail_message_s_mail_message_subtype_id_mail__idx ON public.mail_followers_mail_message_subtype_rel USING btree (mail_message_subtype_id, mail_followers_id);


--
-- Name: mail_gateway_allowed__email_normalized_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_gateway_allowed__email_normalized_index ON public.mail_gateway_allowed USING btree (email_normalized);


--
-- Name: mail_link_preview__create_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_link_preview__create_date_index ON public.mail_link_preview USING btree (create_date);


--
-- Name: mail_link_preview_unique_source_url; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_link_preview_unique_source_url ON public.mail_link_preview USING btree (source_url);


--
-- Name: INDEX mail_link_preview_unique_source_url; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_link_preview_unique_source_url IS 'UNIQUE INDEX (source_url)';


--
-- Name: mail_mail__fetchmail_server_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_mail__fetchmail_server_id_index ON public.mail_mail USING btree (fetchmail_server_id) WHERE (fetchmail_server_id IS NOT NULL);


--
-- Name: mail_mail__mail_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_mail__mail_message_id_index ON public.mail_mail USING btree (mail_message_id);


--
-- Name: mail_mail_res_partner_rel_res_partner_id_mail_mail_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_mail_res_partner_rel_res_partner_id_mail_mail_id_idx ON public.mail_mail_res_partner_rel USING btree (res_partner_id, mail_mail_id);


--
-- Name: mail_message__author_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message__author_id_index ON public.mail_message USING btree (author_id);


--
-- Name: mail_message__mail_activity_type_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message__mail_activity_type_id_index ON public.mail_message USING btree (mail_activity_type_id) WHERE (mail_activity_type_id IS NOT NULL);


--
-- Name: mail_message__message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message__message_id_index ON public.mail_message USING btree (message_id);


--
-- Name: mail_message__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message__parent_id_index ON public.mail_message USING btree (parent_id) WHERE (parent_id IS NOT NULL);


--
-- Name: mail_message__subtype_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message__subtype_id_index ON public.mail_message USING btree (subtype_id);


--
-- Name: mail_message_link_preview__link_preview_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_link_preview__link_preview_id_index ON public.mail_message_link_preview USING btree (link_preview_id);


--
-- Name: mail_message_link_preview__message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_link_preview__message_id_index ON public.mail_message_link_preview USING btree (message_id);


--
-- Name: mail_message_link_preview_unique_message_link_preview; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_message_link_preview_unique_message_link_preview ON public.mail_message_link_preview USING btree (message_id, link_preview_id);


--
-- Name: INDEX mail_message_link_preview_unique_message_link_preview; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_link_preview_unique_message_link_preview IS 'UNIQUE INDEX (message_id, link_preview_id)';


--
-- Name: mail_message_model_res_id_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_model_res_id_id_idx ON public.mail_message USING btree (model, res_id, id);


--
-- Name: INDEX mail_message_model_res_id_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_model_res_id_id_idx IS 'INDEX (model, res_id, id)';


--
-- Name: mail_message_model_res_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_model_res_id_idx ON public.mail_message USING btree (model, res_id);


--
-- Name: INDEX mail_message_model_res_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_model_res_id_idx IS 'INDEX (model, res_id)';


--
-- Name: mail_message_reaction__message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_reaction__message_id_index ON public.mail_message_reaction USING btree (message_id);


--
-- Name: mail_message_reaction_guest_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_message_reaction_guest_unique ON public.mail_message_reaction USING btree (message_id, content, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: INDEX mail_message_reaction_guest_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_reaction_guest_unique IS 'UNIQUE INDEX (message_id, content, guest_id) WHERE guest_id IS NOT NULL';


--
-- Name: mail_message_reaction_partner_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_message_reaction_partner_unique ON public.mail_message_reaction USING btree (message_id, content, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: INDEX mail_message_reaction_partner_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_reaction_partner_unique IS 'UNIQUE INDEX (message_id, content, partner_id) WHERE partner_id IS NOT NULL';


--
-- Name: mail_message_res_partner_rel_res_partner_id_mail_message_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_res_partner_rel_res_partner_id_mail_message_id_idx ON public.mail_message_res_partner_rel USING btree (res_partner_id, mail_message_id);


--
-- Name: mail_message_res_partner_star_res_partner_id_mail_message_i_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_res_partner_star_res_partner_id_mail_message_i_idx ON public.mail_message_res_partner_starred_rel USING btree (res_partner_id, mail_message_id);


--
-- Name: mail_message_translation__create_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_message_translation__create_date_index ON public.mail_message_translation USING btree (create_date);


--
-- Name: mail_message_translation_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_message_translation_unique ON public.mail_message_translation USING btree (message_id, target_lang);


--
-- Name: INDEX mail_message_translation_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_message_translation_unique IS 'UNIQUE INDEX (message_id, target_lang)';


--
-- Name: mail_notification__is_read_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__is_read_index ON public.mail_notification USING btree (is_read);


--
-- Name: mail_notification__letter_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__letter_id_index ON public.mail_notification USING btree (letter_id) WHERE (letter_id IS NOT NULL);


--
-- Name: mail_notification__mail_mail_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__mail_mail_id_index ON public.mail_notification USING btree (mail_mail_id);


--
-- Name: mail_notification__mail_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__mail_message_id_index ON public.mail_notification USING btree (mail_message_id);


--
-- Name: mail_notification__notification_status_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__notification_status_index ON public.mail_notification USING btree (notification_status);


--
-- Name: mail_notification__notification_type_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__notification_type_index ON public.mail_notification USING btree (notification_type);


--
-- Name: mail_notification__res_partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__res_partner_id_index ON public.mail_notification USING btree (res_partner_id);


--
-- Name: mail_notification__sms_id_int_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification__sms_id_int_index ON public.mail_notification USING btree (sms_id_int) WHERE (sms_id_int IS NOT NULL);


--
-- Name: mail_notification_author_id_notification_status_failure; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification_author_id_notification_status_failure ON public.mail_notification USING btree (author_id, notification_status) WHERE ((notification_status)::text = ANY (ARRAY[('bounce'::character varying)::text, ('exception'::character varying)::text]));


--
-- Name: INDEX mail_notification_author_id_notification_status_failure; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_notification_author_id_notification_status_failure IS 'INDEX (author_id, notification_status) WHERE notification_status IN (''bounce'', ''exception'')';


--
-- Name: mail_notification_res_partner_id_is_read_notification__e5e0b7fb; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_notification_res_partner_id_is_read_notification__e5e0b7fb ON public.mail_notification USING btree (res_partner_id, is_read, notification_status, mail_message_id);


--
-- Name: INDEX mail_notification_res_partner_id_is_read_notification__e5e0b7fb; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_notification_res_partner_id_is_read_notification__e5e0b7fb IS 'INDEX (res_partner_id, is_read, notification_status, mail_message_id)';


--
-- Name: mail_notification_unique_mail_message_id_res_partner_id_; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_notification_unique_mail_message_id_res_partner_id_ ON public.mail_notification USING btree (mail_message_id, res_partner_id) WHERE (res_partner_id IS NOT NULL);


--
-- Name: INDEX mail_notification_unique_mail_message_id_res_partner_id_; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_notification_unique_mail_message_id_res_partner_id_ IS 'UNIQUE INDEX (mail_message_id, res_partner_id) WHERE res_partner_id IS NOT NULL';


--
-- Name: mail_presence_guest_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_presence_guest_unique ON public.mail_presence USING btree (guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: INDEX mail_presence_guest_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_presence_guest_unique IS 'UNIQUE INDEX (guest_id) WHERE guest_id IS NOT NULL';


--
-- Name: mail_presence_user_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX mail_presence_user_unique ON public.mail_presence USING btree (user_id) WHERE (user_id IS NOT NULL);


--
-- Name: INDEX mail_presence_user_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.mail_presence_user_unique IS 'UNIQUE INDEX (user_id) WHERE user_id IS NOT NULL';


--
-- Name: mail_push_device__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_push_device__partner_id_index ON public.mail_push_device USING btree (partner_id);


--
-- Name: mail_scheduled_message_res_pa_res_partner_id_mail_scheduled_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_scheduled_message_res_pa_res_partner_id_mail_scheduled_idx ON public.mail_scheduled_message_res_partner_rel USING btree (res_partner_id, mail_scheduled_message_id);


--
-- Name: mail_template__mail_server_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_template__mail_server_id_index ON public.mail_template USING btree (mail_server_id) WHERE (mail_server_id IS NOT NULL);


--
-- Name: mail_template__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_template__model_index ON public.mail_template USING btree (model);


--
-- Name: mail_template_ir_actions_repo_ir_actions_report_id_mail_tem_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_template_ir_actions_repo_ir_actions_report_id_mail_tem_idx ON public.mail_template_ir_actions_report_rel USING btree (ir_actions_report_id, mail_template_id);


--
-- Name: mail_template_mail_template_r_mail_template_id_mail_templat_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_template_mail_template_r_mail_template_id_mail_templat_idx ON public.mail_template_mail_template_reset_rel USING btree (mail_template_id, mail_template_reset_id);


--
-- Name: mail_tracking_value__field_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_tracking_value__field_id_index ON public.mail_tracking_value USING btree (field_id);


--
-- Name: mail_tracking_value__mail_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX mail_tracking_value__mail_message_id_index ON public.mail_tracking_value USING btree (mail_message_id);


--
-- Name: message_attachment_rel_attachment_id_message_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX message_attachment_rel_attachment_id_message_id_idx ON public.message_attachment_rel USING btree (attachment_id, message_id);


--
-- Name: module_country_country_id_module_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX module_country_country_id_module_id_idx ON public.module_country USING btree (country_id, module_id);


--
-- Name: onboarding_onboarding_onboard_onboarding_onboarding_step_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX onboarding_onboarding_onboard_onboarding_onboarding_step_id_idx ON public.onboarding_onboarding_onboarding_onboarding_step_rel USING btree (onboarding_onboarding_step_id, onboarding_onboarding_id);


--
-- Name: onboarding_progress__onboarding_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX onboarding_progress__onboarding_id_index ON public.onboarding_progress USING btree (onboarding_id);


--
-- Name: onboarding_progress_onboardin_onboarding_progress_step_id_o_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX onboarding_progress_onboardin_onboarding_progress_step_id_o_idx ON public.onboarding_progress_onboarding_progress_step_rel USING btree (onboarding_progress_step_id, onboarding_progress_id);


--
-- Name: onboarding_progress_onboarding_company_uniq; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX onboarding_progress_onboarding_company_uniq ON public.onboarding_progress USING btree (onboarding_id, COALESCE(company_id, 0));


--
-- Name: INDEX onboarding_progress_onboarding_company_uniq; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.onboarding_progress_onboarding_company_uniq IS 'UNIQUE INDEX (onboarding_id, COALESCE(company_id, 0))';


--
-- Name: onboarding_progress_step__step_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX onboarding_progress_step__step_id_index ON public.onboarding_progress_step USING btree (step_id);


--
-- Name: onboarding_progress_step_company_uniq; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX onboarding_progress_step_company_uniq ON public.onboarding_progress_step USING btree (step_id, COALESCE(company_id, 0));


--
-- Name: INDEX onboarding_progress_step_company_uniq; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.onboarding_progress_step_company_uniq IS 'UNIQUE INDEX (step_id, COALESCE(company_id, 0))';


--
-- Name: payment_capture_wizard_paymen_payment_transaction_id_paymen_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_capture_wizard_paymen_payment_transaction_id_paymen_idx ON public.payment_capture_wizard_payment_transaction_rel USING btree (payment_transaction_id, payment_capture_wizard_id);


--
-- Name: payment_country_rel_country_id_payment_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_country_rel_country_id_payment_id_idx ON public.payment_country_rel USING btree (country_id, payment_id);


--
-- Name: payment_currency_rel_currency_id_payment_provider_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_currency_rel_currency_id_payment_provider_id_idx ON public.payment_currency_rel USING btree (currency_id, payment_provider_id);


--
-- Name: payment_method__primary_payment_method_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_method__primary_payment_method_id_index ON public.payment_method USING btree (primary_payment_method_id) WHERE (primary_payment_method_id IS NOT NULL);


--
-- Name: payment_method_payment_provid_payment_provider_id_payment_m_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_method_payment_provid_payment_provider_id_payment_m_idx ON public.payment_method_payment_provider_rel USING btree (payment_provider_id, payment_method_id);


--
-- Name: payment_method_res_country_re_res_country_id_payment_method_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_method_res_country_re_res_country_id_payment_method_idx ON public.payment_method_res_country_rel USING btree (res_country_id, payment_method_id);


--
-- Name: payment_method_res_currency_r_res_currency_id_payment_metho_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_method_res_currency_r_res_currency_id_payment_metho_idx ON public.payment_method_res_currency_rel USING btree (res_currency_id, payment_method_id);


--
-- Name: payment_provider__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_provider__company_id_index ON public.payment_provider USING btree (company_id);


--
-- Name: payment_token__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_token__company_id_index ON public.payment_token USING btree (company_id);


--
-- Name: payment_token__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_token__partner_id_index ON public.payment_token USING btree (partner_id);


--
-- Name: payment_transaction__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_transaction__company_id_index ON public.payment_transaction USING btree (company_id);


--
-- Name: payment_transaction__operation_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_transaction__operation_index ON public.payment_transaction USING btree (operation);


--
-- Name: payment_transaction__source_transaction_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_transaction__source_transaction_id_index ON public.payment_transaction USING btree (source_transaction_id) WHERE (source_transaction_id IS NOT NULL);


--
-- Name: payment_transaction__state_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_transaction__state_index ON public.payment_transaction USING btree (state);


--
-- Name: payment_transaction__token_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX payment_transaction__token_id_index ON public.payment_transaction USING btree (token_id) WHERE (token_id IS NOT NULL);


--
-- Name: portal_share_res_partner_rel_res_partner_id_portal_share_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX portal_share_res_partner_rel_res_partner_id_portal_share_id_idx ON public.portal_share_res_partner_rel USING btree (res_partner_id, portal_share_id);


--
-- Name: portal_wizard_res_partner_rel_res_partner_id_portal_wizard__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX portal_wizard_res_partner_rel_res_partner_id_portal_wizard__idx ON public.portal_wizard_res_partner_rel USING btree (res_partner_id, portal_wizard_id);


--
-- Name: product_accessory_rel_dest_id_src_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_accessory_rel_dest_id_src_id_idx ON public.product_accessory_rel USING btree (dest_id, src_id);


--
-- Name: product_alternative_rel_dest_id_src_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_alternative_rel_dest_id_src_id_idx ON public.product_alternative_rel USING btree (dest_id, src_id);


--
-- Name: product_attr_exclusion_value__product_template_attribute_va_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attr_exclusion_value__product_template_attribute_va_idx ON public.product_attr_exclusion_value_ids_rel USING btree (product_template_attribute_value_id, product_template_attribute_exclusion_id);


--
-- Name: product_attribute__sequence_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute__sequence_index ON public.product_attribute USING btree (sequence);


--
-- Name: product_attribute_custom_value__sale_order_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute_custom_value__sale_order_line_id_index ON public.product_attribute_custom_value USING btree (sale_order_line_id) WHERE (sale_order_line_id IS NOT NULL);


--
-- Name: product_attribute_product_tem_product_template_id_product_a_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute_product_tem_product_template_id_product_a_idx ON public.product_attribute_product_template_rel USING btree (product_template_id, product_attribute_id);


--
-- Name: product_attribute_value__attribute_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute_value__attribute_id_index ON public.product_attribute_value USING btree (attribute_id);


--
-- Name: product_attribute_value__sequence_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute_value__sequence_index ON public.product_attribute_value USING btree (sequence);


--
-- Name: product_attribute_value_produ_product_template_attribute_li_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_attribute_value_produ_product_template_attribute_li_idx ON public.product_attribute_value_product_template_attribute_line_rel USING btree (product_template_attribute_line_id, product_attribute_value_id);


--
-- Name: product_category__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_category__name_index ON public.product_category USING gin (public.unaccent((name)::text) public.gin_trgm_ops);


--
-- Name: product_category__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_category__parent_id_index ON public.product_category USING btree (parent_id);


--
-- Name: product_category__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_category__parent_path_index ON public.product_category USING btree (parent_path);


--
-- Name: product_category__property_account_expense_categ_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_category__property_account_expense_categ_id_index ON public.product_category USING btree (((property_account_expense_categ_id IS NOT NULL))) WHERE (property_account_expense_categ_id IS NOT NULL);


--
-- Name: product_category__property_account_income_categ_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_category__property_account_income_categ_id_index ON public.product_category USING btree (((property_account_income_categ_id IS NOT NULL))) WHERE (property_account_income_categ_id IS NOT NULL);


--
-- Name: product_combo__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_combo__company_id_index ON public.product_combo USING btree (company_id);


--
-- Name: product_combo_item__combo_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_combo_item__combo_id_index ON public.product_combo_item USING btree (combo_id);


--
-- Name: product_combo_product_templat_product_combo_id_product_temp_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_combo_product_templat_product_combo_id_product_temp_idx ON public.product_combo_product_template_rel USING btree (product_combo_id, product_template_id);


--
-- Name: product_document_sale_pdf_for_sale_pdf_form_field_id_produc_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_document_sale_pdf_for_sale_pdf_form_field_id_produc_idx ON public.product_document_sale_pdf_form_field_rel USING btree (sale_pdf_form_field_id, product_document_id);


--
-- Name: product_fetch_image_wizard_pr_product_product_id_product_fe_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_fetch_image_wizard_pr_product_product_id_product_fe_idx ON public.product_fetch_image_wizard_product_product_rel USING btree (product_product_id, product_fetch_image_wizard_id);


--
-- Name: product_image__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_image__product_tmpl_id_index ON public.product_image USING btree (product_tmpl_id);


--
-- Name: product_image__product_variant_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_image__product_variant_id_index ON public.product_image USING btree (product_variant_id);


--
-- Name: product_label_layout_product__product_product_id_product_la_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_label_layout_product__product_product_id_product_la_idx ON public.product_label_layout_product_product_rel USING btree (product_product_id, product_label_layout_id);


--
-- Name: product_label_layout_product__product_template_id_product_l_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_label_layout_product__product_template_id_product_l_idx ON public.product_label_layout_product_template_rel USING btree (product_template_id, product_label_layout_id);


--
-- Name: product_optional_rel_dest_id_src_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_optional_rel_dest_id_src_id_idx ON public.product_optional_rel USING btree (dest_id, src_id);


--
-- Name: product_pricelist_item__compute_price_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_pricelist_item__compute_price_index ON public.product_pricelist_item USING btree (compute_price);


--
-- Name: product_pricelist_item__pricelist_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_pricelist_item__pricelist_id_index ON public.product_pricelist_item USING btree (pricelist_id);


--
-- Name: product_pricelist_item__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_pricelist_item__product_id_index ON public.product_pricelist_item USING btree (product_id) WHERE (product_id IS NOT NULL);


--
-- Name: product_pricelist_item__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_pricelist_item__product_tmpl_id_index ON public.product_pricelist_item USING btree (product_tmpl_id) WHERE (product_tmpl_id IS NOT NULL);


--
-- Name: product_product__barcode_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product__barcode_index ON public.product_product USING btree (barcode) WHERE (barcode IS NOT NULL);


--
-- Name: product_product__combination_indices_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product__combination_indices_index ON public.product_product USING btree (combination_indices);


--
-- Name: product_product__default_code_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product__default_code_index ON public.product_product USING btree (default_code);


--
-- Name: product_product__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product__product_tmpl_id_index ON public.product_product USING btree (product_tmpl_id);


--
-- Name: product_product__standard_price_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product__standard_price_index ON public.product_product USING btree (((standard_price IS NOT NULL))) WHERE (standard_price IS NOT NULL);


--
-- Name: product_product_combination_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX product_product_combination_unique ON public.product_product USING btree (product_tmpl_id, combination_indices) WHERE (active IS TRUE);


--
-- Name: INDEX product_product_combination_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.product_product_combination_unique IS 'UNIQUE INDEX (product_tmpl_id, combination_indices) WHERE active IS TRUE';


--
-- Name: product_product_is_favorite_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_product_is_favorite_index ON public.product_product USING btree (is_favorite) WHERE (is_favorite IS TRUE);


--
-- Name: INDEX product_product_is_favorite_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.product_product_is_favorite_index IS 'INDEX (is_favorite) WHERE is_favorite IS TRUE';


--
-- Name: product_public_category__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_public_category__parent_id_index ON public.product_public_category USING btree (parent_id);


--
-- Name: product_public_category__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_public_category__parent_path_index ON public.product_public_category USING btree (parent_path);


--
-- Name: product_public_category__sequence_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_public_category__sequence_index ON public.product_public_category USING btree (sequence);


--
-- Name: product_public_category__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_public_category__website_id_index ON public.product_public_category USING btree (website_id);


--
-- Name: product_public_category_produ_product_template_id_product_p_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_public_category_produ_product_template_id_product_p_idx ON public.product_public_category_product_template_rel USING btree (product_template_id, product_public_category_id);


--
-- Name: product_supplier_taxes_rel_tax_id_prod_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_supplier_taxes_rel_tax_id_prod_id_idx ON public.product_supplier_taxes_rel USING btree (tax_id, prod_id);


--
-- Name: product_supplierinfo__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_supplierinfo__company_id_index ON public.product_supplierinfo USING btree (company_id);


--
-- Name: product_supplierinfo__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_supplierinfo__product_tmpl_id_index ON public.product_supplierinfo USING btree (product_tmpl_id);


--
-- Name: product_tag__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_tag__website_id_index ON public.product_tag USING btree (website_id);


--
-- Name: product_tag_delivery_carrier__product_tag_id_delivery_carr_idx1; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_tag_delivery_carrier__product_tag_id_delivery_carr_idx1 ON public.product_tag_delivery_carrier_excluded_rel USING btree (product_tag_id, delivery_carrier_id);


--
-- Name: product_tag_delivery_carrier__product_tag_id_delivery_carri_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_tag_delivery_carrier__product_tag_id_delivery_carri_idx ON public.product_tag_delivery_carrier_must_have_rel USING btree (product_tag_id, delivery_carrier_id);


--
-- Name: product_tag_product_product_r_product_tag_id_product_produc_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_tag_product_product_r_product_tag_id_product_produc_idx ON public.product_tag_product_product_rel USING btree (product_tag_id, product_product_id);


--
-- Name: product_tag_product_template__product_tag_id_product_templa_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_tag_product_template__product_tag_id_product_templa_idx ON public.product_tag_product_template_rel USING btree (product_tag_id, product_template_id);


--
-- Name: product_taxes_rel_tax_id_prod_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_taxes_rel_tax_id_prod_id_idx ON public.product_taxes_rel USING btree (tax_id, prod_id);


--
-- Name: product_template__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__company_id_index ON public.product_template USING btree (company_id);


--
-- Name: product_template__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__is_published_index ON public.product_template USING btree (is_published);


--
-- Name: product_template__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__name_index ON public.product_template USING gin (public.unaccent((jsonb_path_query_array(name, '$.*'::jsonpath))::text) public.gin_trgm_ops);


--
-- Name: product_template__property_account_expense_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__property_account_expense_id_index ON public.product_template USING btree (((property_account_expense_id IS NOT NULL))) WHERE (property_account_expense_id IS NOT NULL);


--
-- Name: product_template__property_account_income_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__property_account_income_id_index ON public.product_template USING btree (((property_account_income_id IS NOT NULL))) WHERE (property_account_income_id IS NOT NULL);


--
-- Name: product_template__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__website_id_index ON public.product_template USING btree (website_id);


--
-- Name: product_template__website_sequence_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template__website_sequence_index ON public.product_template USING btree (website_sequence);


--
-- Name: product_template_attribute_exclusion__product_template_5b2f8938; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_exclusion__product_template_5b2f8938 ON public.product_template_attribute_exclusion USING btree (product_template_attribute_value_id);


--
-- Name: product_template_attribute_exclusion__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_exclusion__product_tmpl_id_index ON public.product_template_attribute_exclusion USING btree (product_tmpl_id);


--
-- Name: product_template_attribute_line__attribute_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_line__attribute_id_index ON public.product_template_attribute_line USING btree (attribute_id);


--
-- Name: product_template_attribute_line__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_line__product_tmpl_id_index ON public.product_template_attribute_line USING btree (product_tmpl_id);


--
-- Name: product_template_attribute_va_product_template_attribute_va_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_va_product_template_attribute_va_idx ON public.product_template_attribute_value_sale_order_line_rel USING btree (product_template_attribute_value_id, sale_order_line_id);


--
-- Name: product_template_attribute_value__attribute_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_value__attribute_id_index ON public.product_template_attribute_value USING btree (attribute_id);


--
-- Name: product_template_attribute_value__attribute_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_value__attribute_line_id_index ON public.product_template_attribute_value USING btree (attribute_line_id);


--
-- Name: product_template_attribute_value__product_attribute_va_63041d9e; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_value__product_attribute_va_63041d9e ON public.product_template_attribute_value USING btree (product_attribute_value_id);


--
-- Name: product_template_attribute_value__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_attribute_value__product_tmpl_id_index ON public.product_template_attribute_value USING btree (product_tmpl_id);


--
-- Name: product_template_is_favorite_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_is_favorite_index ON public.product_template USING btree (is_favorite) WHERE (is_favorite IS TRUE);


--
-- Name: INDEX product_template_is_favorite_index; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.product_template_is_favorite_index IS 'INDEX (is_favorite) WHERE is_favorite IS TRUE';


--
-- Name: product_template_uom_uom_rel_uom_uom_id_product_template_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_template_uom_uom_rel_uom_uom_id_product_template_id_idx ON public.product_template_uom_uom_rel USING btree (uom_uom_id, product_template_id);


--
-- Name: product_uom__barcode_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_uom__barcode_index ON public.product_uom USING btree (barcode) WHERE (barcode IS NOT NULL);


--
-- Name: product_uom__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_uom__product_id_index ON public.product_uom USING btree (product_id);


--
-- Name: product_uom__uom_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_uom__uom_id_index ON public.product_uom USING btree (uom_id);


--
-- Name: product_variant_combination_product_template_attribute_valu_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX product_variant_combination_product_template_attribute_valu_idx ON public.product_variant_combination USING btree (product_template_attribute_value_id, product_product_id);


--
-- Name: quotation_document_sale_order_quotation_document_id_sale_or_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX quotation_document_sale_order_quotation_document_id_sale_or_idx ON public.quotation_document_sale_order_rel USING btree (quotation_document_id, sale_order_id);


--
-- Name: quotation_document_sale_pdf_f_sale_pdf_form_field_id_quotat_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX quotation_document_sale_pdf_f_sale_pdf_form_field_id_quotat_idx ON public.quotation_document_sale_pdf_form_field_rel USING btree (sale_pdf_form_field_id, quotation_document_id);


--
-- Name: rating_rating__message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__message_id_index ON public.rating_rating USING btree (message_id);


--
-- Name: rating_rating__parent_res_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__parent_res_id_index ON public.rating_rating USING btree (parent_res_id);


--
-- Name: rating_rating__parent_res_model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__parent_res_model_id_index ON public.rating_rating USING btree (parent_res_model_id);


--
-- Name: rating_rating__parent_res_model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__parent_res_model_index ON public.rating_rating USING btree (parent_res_model);


--
-- Name: rating_rating__publisher_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__publisher_id_index ON public.rating_rating USING btree (publisher_id) WHERE (publisher_id IS NOT NULL);


--
-- Name: rating_rating__res_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__res_id_index ON public.rating_rating USING btree (res_id);


--
-- Name: rating_rating__res_model_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__res_model_id_index ON public.rating_rating USING btree (res_model_id);


--
-- Name: rating_rating__res_model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating__res_model_index ON public.rating_rating USING btree (res_model);


--
-- Name: rating_rating_consumed_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating_consumed_idx ON public.rating_rating USING btree (res_model, res_id, write_date) WHERE (consumed IS TRUE);


--
-- Name: INDEX rating_rating_consumed_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.rating_rating_consumed_idx IS 'INDEX (res_model, res_id, write_date) WHERE consumed IS TRUE';


--
-- Name: rating_rating_parent_consumed_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rating_rating_parent_consumed_idx ON public.rating_rating USING btree (parent_res_model, parent_res_id, write_date) WHERE (consumed IS TRUE);


--
-- Name: INDEX rating_rating_parent_consumed_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.rating_rating_parent_consumed_idx IS 'INDEX (parent_res_model, parent_res_id, write_date) WHERE consumed IS TRUE';


--
-- Name: rel_followup_manual_reminder__res_partner_id_account_follow_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rel_followup_manual_reminder__res_partner_id_account_follow_idx ON public.rel_followup_manual_reminder_res_partner USING btree (res_partner_id, account_followup_manual_reminder_id);


--
-- Name: rel_modules_langexport_module_id_wiz_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rel_modules_langexport_module_id_wiz_id_idx ON public.rel_modules_langexport USING btree (module_id, wiz_id);


--
-- Name: res_bank__bic_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_bank__bic_index ON public.res_bank USING btree (bic);


--
-- Name: res_company__account_representative_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company__account_representative_id_index ON public.res_company USING btree (account_representative_id) WHERE (account_representative_id IS NOT NULL);


--
-- Name: res_company__alias_domain_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company__alias_domain_id_index ON public.res_company USING btree (alias_domain_id) WHERE (alias_domain_id IS NOT NULL);


--
-- Name: res_company__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company__parent_id_index ON public.res_company USING btree (parent_id);


--
-- Name: res_company__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company__parent_path_index ON public.res_company USING btree (parent_path);


--
-- Name: res_company__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company__partner_id_index ON public.res_company USING btree (partner_id);


--
-- Name: res_company_users_rel_user_id_cid_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_company_users_rel_user_id_cid_idx ON public.res_company_users_rel USING btree (user_id, cid);


--
-- Name: res_country_group_pricelist_r_res_country_group_id_pricelis_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_country_group_pricelist_r_res_country_group_id_pricelis_idx ON public.res_country_group_pricelist_rel USING btree (res_country_group_id, pricelist_id);


--
-- Name: res_country_group_res_country_res_country_state_id_res_coun_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_country_group_res_country_res_country_state_id_res_coun_idx ON public.res_country_group_res_country_state_rel USING btree (res_country_state_id, res_country_group_id);


--
-- Name: res_country_res_country_group_res_country_group_id_res_coun_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_country_res_country_group_res_country_group_id_res_coun_idx ON public.res_country_res_country_group_rel USING btree (res_country_group_id, res_country_id);


--
-- Name: res_country_state__country_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_country_state__country_id_index ON public.res_country_state USING btree (country_id);


--
-- Name: res_currency_rate__currency_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_currency_rate__currency_id_index ON public.res_currency_rate USING btree (currency_id);


--
-- Name: res_currency_rate__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_currency_rate__name_index ON public.res_currency_rate USING btree (name);


--
-- Name: res_device_log__last_activity_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_device_log__last_activity_index ON public.res_device_log USING btree (last_activity);


--
-- Name: res_device_log__session_identifier_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_device_log__session_identifier_index ON public.res_device_log USING btree (session_identifier);


--
-- Name: res_device_log__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_device_log__user_id_index ON public.res_device_log USING btree (user_id);


--
-- Name: res_device_log_composite_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_device_log_composite_idx ON public.res_device_log USING btree (user_id, session_identifier, platform, browser, last_activity, id) WHERE (revoked IS NOT TRUE);


--
-- Name: INDEX res_device_log_composite_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.res_device_log_composite_idx IS 'INDEX (user_id, session_identifier, platform, browser, last_activity, id) WHERE revoked IS NOT TRUE';


--
-- Name: res_groups__privilege_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups__privilege_id_index ON public.res_groups USING btree (privilege_id);


--
-- Name: res_groups_implied_rel_hid_gid_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_implied_rel_hid_gid_idx ON public.res_groups_implied_rel USING btree (hid, gid);


--
-- Name: res_groups_privilege__category_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_privilege__category_id_index ON public.res_groups_privilege USING btree (category_id);


--
-- Name: res_groups_report_rel_gid_uid_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_report_rel_gid_uid_idx ON public.res_groups_report_rel USING btree (gid, uid);


--
-- Name: res_groups_spreadsheet_dashbo_res_groups_id_spreadsheet_das_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_spreadsheet_dashbo_res_groups_id_spreadsheet_das_idx ON public.res_groups_spreadsheet_dashboard_rel USING btree (res_groups_id, spreadsheet_dashboard_id);


--
-- Name: res_groups_users_rel_uid_gid_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_users_rel_uid_gid_idx ON public.res_groups_users_rel USING btree (uid, gid);


--
-- Name: res_groups_website_menu_rel_res_groups_id_website_menu_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_groups_website_menu_rel_res_groups_id_website_menu_id_idx ON public.res_groups_website_menu_rel USING btree (res_groups_id, website_menu_id);


--
-- Name: res_lang_install_rel_lang_id_language_wizard_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_lang_install_rel_lang_id_language_wizard_id_idx ON public.res_lang_install_rel USING btree (lang_id, language_wizard_id);


--
-- Name: res_partner__barcode_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__barcode_index ON public.res_partner USING btree (((barcode IS NOT NULL))) WHERE (barcode IS NOT NULL);


--
-- Name: res_partner__commercial_partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__commercial_partner_id_index ON public.res_partner USING btree (commercial_partner_id);


--
-- Name: res_partner__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__company_id_index ON public.res_partner USING btree (company_id);


--
-- Name: res_partner__complete_name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__complete_name_index ON public.res_partner USING btree (complete_name);


--
-- Name: res_partner__credit_limit_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__credit_limit_index ON public.res_partner USING btree (((credit_limit IS NOT NULL))) WHERE (credit_limit IS NOT NULL);


--
-- Name: res_partner__followup_next_action_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__followup_next_action_date_index ON public.res_partner USING btree (((followup_next_action_date IS NOT NULL))) WHERE (followup_next_action_date IS NOT NULL);


--
-- Name: res_partner__followup_responsible_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__followup_responsible_id_index ON public.res_partner USING btree (((followup_responsible_id IS NOT NULL))) WHERE (followup_responsible_id IS NOT NULL);


--
-- Name: res_partner__ignore_abnormal_invoice_amount_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__ignore_abnormal_invoice_amount_index ON public.res_partner USING btree (((ignore_abnormal_invoice_amount IS NOT NULL))) WHERE (ignore_abnormal_invoice_amount IS NOT NULL);


--
-- Name: res_partner__ignore_abnormal_invoice_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__ignore_abnormal_invoice_date_index ON public.res_partner USING btree (((ignore_abnormal_invoice_date IS NOT NULL))) WHERE (ignore_abnormal_invoice_date IS NOT NULL);


--
-- Name: res_partner__invoice_edi_format_store_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__invoice_edi_format_store_index ON public.res_partner USING btree (((invoice_edi_format_store IS NOT NULL))) WHERE (invoice_edi_format_store IS NOT NULL);


--
-- Name: res_partner__invoice_sending_method_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__invoice_sending_method_index ON public.res_partner USING btree (((invoice_sending_method IS NOT NULL))) WHERE (invoice_sending_method IS NOT NULL);


--
-- Name: res_partner__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__is_published_index ON public.res_partner USING btree (is_published);


--
-- Name: res_partner__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__name_index ON public.res_partner USING btree (name);


--
-- Name: res_partner__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__parent_id_index ON public.res_partner USING btree (parent_id);


--
-- Name: res_partner__property_account_payable_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_account_payable_id_index ON public.res_partner USING btree (((property_account_payable_id IS NOT NULL))) WHERE (property_account_payable_id IS NOT NULL);


--
-- Name: res_partner__property_account_position_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_account_position_id_index ON public.res_partner USING btree (((property_account_position_id IS NOT NULL))) WHERE (property_account_position_id IS NOT NULL);


--
-- Name: res_partner__property_account_receivable_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_account_receivable_id_index ON public.res_partner USING btree (((property_account_receivable_id IS NOT NULL))) WHERE (property_account_receivable_id IS NOT NULL);


--
-- Name: res_partner__property_delivery_carrier_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_delivery_carrier_id_index ON public.res_partner USING btree (((property_delivery_carrier_id IS NOT NULL))) WHERE (property_delivery_carrier_id IS NOT NULL);


--
-- Name: res_partner__property_inbound_payment_method_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_inbound_payment_method_line_id_index ON public.res_partner USING btree (((property_inbound_payment_method_line_id IS NOT NULL))) WHERE (property_inbound_payment_method_line_id IS NOT NULL);


--
-- Name: res_partner__property_outbound_payment_method_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_outbound_payment_method_line_id_index ON public.res_partner USING btree (((property_outbound_payment_method_line_id IS NOT NULL))) WHERE (property_outbound_payment_method_line_id IS NOT NULL);


--
-- Name: res_partner__property_payment_term_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_payment_term_id_index ON public.res_partner USING btree (((property_payment_term_id IS NOT NULL))) WHERE (property_payment_term_id IS NOT NULL);


--
-- Name: res_partner__property_supplier_payment_term_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__property_supplier_payment_term_id_index ON public.res_partner USING btree (((property_supplier_payment_term_id IS NOT NULL))) WHERE (property_supplier_payment_term_id IS NOT NULL);


--
-- Name: res_partner__ref_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__ref_index ON public.res_partner USING btree (ref);


--
-- Name: res_partner__specific_property_product_pricelist_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__specific_property_product_pricelist_index ON public.res_partner USING btree (((specific_property_product_pricelist IS NOT NULL))) WHERE (specific_property_product_pricelist IS NOT NULL);


--
-- Name: res_partner__trust_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__trust_index ON public.res_partner USING btree (((trust IS NOT NULL))) WHERE (trust IS NOT NULL);


--
-- Name: res_partner__vat_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__vat_index ON public.res_partner USING btree (vat);


--
-- Name: res_partner__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner__website_id_index ON public.res_partner USING btree (website_id);


--
-- Name: res_partner_bank__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_bank__partner_id_index ON public.res_partner_bank USING btree (partner_id);


--
-- Name: res_partner_category__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_category__parent_id_index ON public.res_partner_category USING btree (parent_id);


--
-- Name: res_partner_category__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_category__parent_path_index ON public.res_partner_category USING btree (parent_path);


--
-- Name: res_partner_phone_partial_gin_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_phone_partial_gin_idx ON public.res_partner USING gin (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (phone IS NOT NULL);


--
-- Name: res_partner_phone_partial_tgm; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_phone_partial_tgm ON public.res_partner USING btree (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text)) WHERE (phone IS NOT NULL);


--
-- Name: res_partner_res_partner_category_rel_partner_id_category_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_partner_res_partner_category_rel_partner_id_category_id_idx ON public.res_partner_res_partner_category_rel USING btree (partner_id, category_id);


--
-- Name: res_role_res_users_rel_res_users_id_res_role_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_role_res_users_rel_res_users_id_res_role_id_idx ON public.res_role_res_users_rel USING btree (res_users_id, res_role_id);


--
-- Name: res_role_unique_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX res_role_unique_name ON public.res_role USING btree (name);


--
-- Name: INDEX res_role_unique_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.res_role_unique_name IS 'UNIQUE INDEX (name)';


--
-- Name: res_users__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users__partner_id_index ON public.res_users USING btree (partner_id);


--
-- Name: res_users_apikeys_user_id_index_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_apikeys_user_id_index_idx ON public.res_users_apikeys USING btree (user_id, index);


--
-- Name: res_users_settings__mute_until_dt_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_settings__mute_until_dt_index ON public.res_users_settings USING btree (mute_until_dt);


--
-- Name: res_users_settings_volumes__guest_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_settings_volumes__guest_id_index ON public.res_users_settings_volumes USING btree (guest_id);


--
-- Name: res_users_settings_volumes__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_settings_volumes__partner_id_index ON public.res_users_settings_volumes USING btree (partner_id);


--
-- Name: res_users_settings_volumes__user_setting_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_settings_volumes__user_setting_id_index ON public.res_users_settings_volumes USING btree (user_setting_id);


--
-- Name: res_users_settings_volumes_guest_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX res_users_settings_volumes_guest_unique ON public.res_users_settings_volumes USING btree (user_setting_id, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: INDEX res_users_settings_volumes_guest_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.res_users_settings_volumes_guest_unique IS 'UNIQUE INDEX (user_setting_id, guest_id) WHERE guest_id IS NOT NULL';


--
-- Name: res_users_settings_volumes_partner_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX res_users_settings_volumes_partner_unique ON public.res_users_settings_volumes USING btree (user_setting_id, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: INDEX res_users_settings_volumes_partner_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.res_users_settings_volumes_partner_unique IS 'UNIQUE INDEX (user_setting_id, partner_id) WHERE partner_id IS NOT NULL';


--
-- Name: res_users_spreadsheet_dashboa_res_users_id_spreadsheet_dash_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_spreadsheet_dashboa_res_users_id_spreadsheet_dash_idx ON public.res_users_spreadsheet_dashboard_rel USING btree (res_users_id, spreadsheet_dashboard_id);


--
-- Name: res_users_web_tour_tour_rel_res_users_id_web_tour_tour_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX res_users_web_tour_tour_rel_res_users_id_web_tour_tour_id_idx ON public.res_users_web_tour_tour_rel USING btree (res_users_id, web_tour_tour_id);


--
-- Name: resource_calendar__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar__company_id_index ON public.resource_calendar USING btree (company_id) WHERE (company_id IS NOT NULL);


--
-- Name: resource_calendar_attendance__calendar_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar_attendance__calendar_id_index ON public.resource_calendar_attendance USING btree (calendar_id);


--
-- Name: resource_calendar_attendance__dayofweek_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar_attendance__dayofweek_index ON public.resource_calendar_attendance USING btree (dayofweek);


--
-- Name: resource_calendar_attendance__hour_from_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar_attendance__hour_from_index ON public.resource_calendar_attendance USING btree (hour_from);


--
-- Name: resource_calendar_leaves__calendar_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar_leaves__calendar_id_index ON public.resource_calendar_leaves USING btree (calendar_id);


--
-- Name: resource_calendar_leaves__resource_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_calendar_leaves__resource_id_index ON public.resource_calendar_leaves USING btree (resource_id);


--
-- Name: resource_resource__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX resource_resource__user_id_index ON public.resource_resource USING btree (user_id) WHERE (user_id IS NOT NULL);


--
-- Name: rule_group_rel_group_id_rule_group_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX rule_group_rel_group_id_rule_group_id_idx ON public.rule_group_rel USING btree (group_id, rule_group_id);


--
-- Name: sale_advance_payment_inv_sale_sale_order_id_sale_advance_pa_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_advance_payment_inv_sale_sale_order_id_sale_advance_pa_idx ON public.sale_advance_payment_inv_sale_order_rel USING btree (sale_order_id, sale_advance_payment_inv_id);


--
-- Name: sale_order__campaign_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__campaign_id_index ON public.sale_order USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


--
-- Name: sale_order__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__company_id_index ON public.sale_order USING btree (company_id);


--
-- Name: sale_order__create_date_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__create_date_index ON public.sale_order USING btree (create_date);


--
-- Name: sale_order__medium_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__medium_id_index ON public.sale_order USING btree (medium_id) WHERE (medium_id IS NOT NULL);


--
-- Name: sale_order__name_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__name_index ON public.sale_order USING gin (public.unaccent((name)::text) public.gin_trgm_ops);


--
-- Name: sale_order__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__partner_id_index ON public.sale_order USING btree (partner_id);


--
-- Name: sale_order__partner_invoice_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__partner_invoice_id_index ON public.sale_order USING btree (partner_invoice_id) WHERE (partner_invoice_id IS NOT NULL);


--
-- Name: sale_order__partner_shipping_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__partner_shipping_id_index ON public.sale_order USING btree (partner_shipping_id) WHERE (partner_shipping_id IS NOT NULL);


--
-- Name: sale_order__source_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__source_id_index ON public.sale_order USING btree (source_id) WHERE (source_id IS NOT NULL);


--
-- Name: sale_order__state_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__state_index ON public.sale_order USING btree (state);


--
-- Name: sale_order__user_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order__user_id_index ON public.sale_order USING btree (user_id);


--
-- Name: sale_order_date_order_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_date_order_id_idx ON public.sale_order USING btree (date_order DESC, id DESC);


--
-- Name: INDEX sale_order_date_order_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.sale_order_date_order_id_idx IS 'INDEX (date_order desc, id desc)';


--
-- Name: sale_order_line__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__company_id_index ON public.sale_order_line USING btree (company_id);


--
-- Name: sale_order_line__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__event_id_index ON public.sale_order_line USING btree (event_id) WHERE (event_id IS NOT NULL);


--
-- Name: sale_order_line__linked_line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__linked_line_id_index ON public.sale_order_line USING btree (linked_line_id);


--
-- Name: sale_order_line__order_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__order_id_index ON public.sale_order_line USING btree (order_id);


--
-- Name: sale_order_line__order_partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__order_partner_id_index ON public.sale_order_line USING btree (order_partner_id);


--
-- Name: sale_order_line__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line__product_id_index ON public.sale_order_line USING btree (product_id) WHERE (product_id IS NOT NULL);


--
-- Name: sale_order_line_analytic_distribution_accounts_gin_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line_analytic_distribution_accounts_gin_index ON public.sale_order_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: sale_order_line_invoice_rel_order_line_id_invoice_line_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line_invoice_rel_order_line_id_invoice_line_id_idx ON public.sale_order_line_invoice_rel USING btree (order_line_id, invoice_line_id);


--
-- Name: sale_order_line_product_docum_product_document_id_sale_orde_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_line_product_docum_product_document_id_sale_orde_idx ON public.sale_order_line_product_document_rel USING btree (product_document_id, sale_order_line_id);


--
-- Name: sale_order_mass_cancel_wizard_sale_order_id_sale_mass_cance_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_mass_cancel_wizard_sale_order_id_sale_mass_cance_idx ON public.sale_order_mass_cancel_wizard_rel USING btree (sale_order_id, sale_mass_cancel_orders_id);


--
-- Name: sale_order_option__line_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_option__line_id_index ON public.sale_order_option USING btree (line_id) WHERE (line_id IS NOT NULL);


--
-- Name: sale_order_option__order_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_option__order_id_index ON public.sale_order_option USING btree (order_id);


--
-- Name: sale_order_spreadsheet__order_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_spreadsheet__order_id_index ON public.sale_order_spreadsheet USING btree (order_id) WHERE (order_id IS NOT NULL);


--
-- Name: sale_order_tag_rel_tag_id_order_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_tag_rel_tag_id_order_id_idx ON public.sale_order_tag_rel USING btree (tag_id, order_id);


--
-- Name: sale_order_template__journal_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_template__journal_id_index ON public.sale_order_template USING btree (((journal_id IS NOT NULL))) WHERE (journal_id IS NOT NULL);


--
-- Name: sale_order_template_line__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_template_line__company_id_index ON public.sale_order_template_line USING btree (company_id);


--
-- Name: sale_order_template_line__sale_order_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_template_line__sale_order_template_id_index ON public.sale_order_template_line USING btree (sale_order_template_id);


--
-- Name: sale_order_template_option__company_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_template_option__company_id_index ON public.sale_order_template_option USING btree (company_id);


--
-- Name: sale_order_template_option__sale_order_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_template_option__sale_order_template_id_index ON public.sale_order_template_option USING btree (sale_order_template_id);


--
-- Name: sale_order_transaction_rel_sale_order_id_transaction_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sale_order_transaction_rel_sale_order_id_transaction_id_idx ON public.sale_order_transaction_rel USING btree (sale_order_id, transaction_id);


--
-- Name: scheduled_message_attachment__attachment_id_scheduled_messa_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX scheduled_message_attachment__attachment_id_scheduled_messa_idx ON public.scheduled_message_attachment_rel USING btree (attachment_id, scheduled_message_id);


--
-- Name: sms_sms__mail_message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sms_sms__mail_message_id_index ON public.sms_sms USING btree (mail_message_id);


--
-- Name: sms_template__model_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sms_template__model_index ON public.sms_template USING btree (model);


--
-- Name: sms_template_sms_template_res_sms_template_id_sms_template__idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sms_template_sms_template_res_sms_template_id_sms_template__idx ON public.sms_template_sms_template_reset_rel USING btree (sms_template_id, sms_template_reset_id);


--
-- Name: sms_tracker__mail_notification_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX sms_tracker__mail_notification_id_index ON public.sms_tracker USING btree (mail_notification_id) WHERE (mail_notification_id IS NOT NULL);


--
-- Name: snailmail_letter__attachment_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX snailmail_letter__attachment_id_index ON public.snailmail_letter USING btree (attachment_id) WHERE (attachment_id IS NOT NULL);


--
-- Name: snailmail_letter__message_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX snailmail_letter__message_id_index ON public.snailmail_letter USING btree (message_id) WHERE (message_id IS NOT NULL);


--
-- Name: spreadsheet_dashboard__dashboard_group_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX spreadsheet_dashboard__dashboard_group_id_index ON public.spreadsheet_dashboard USING btree (dashboard_group_id);


--
-- Name: spreadsheet_revision__revision_uuid_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX spreadsheet_revision__revision_uuid_index ON public.spreadsheet_revision USING btree (revision_uuid);


--
-- Name: spreadsheet_revision_initial_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX spreadsheet_revision_initial_unique ON public.spreadsheet_revision USING btree (res_model, res_id) WHERE (parent_revision_id IS NULL);


--
-- Name: INDEX spreadsheet_revision_initial_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.spreadsheet_revision_initial_unique IS 'UNIQUE INDEX (res_model, res_id) WHERE parent_revision_id IS NULL';


--
-- Name: spreadsheet_revision_parent_unique; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX spreadsheet_revision_parent_unique ON public.spreadsheet_revision USING btree (parent_revision_id, res_model, res_id) WHERE (parent_revision_id IS NOT NULL);


--
-- Name: INDEX spreadsheet_revision_parent_unique; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.spreadsheet_revision_parent_unique IS 'UNIQUE INDEX (parent_revision_id, res_model, res_id) WHERE parent_revision_id IS NOT NULL';


--
-- Name: spreadsheet_revision_res_model_res_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX spreadsheet_revision_res_model_res_id_idx ON public.spreadsheet_revision USING btree (res_model, res_id);


--
-- Name: INDEX spreadsheet_revision_res_model_res_id_idx; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON INDEX public.spreadsheet_revision_res_model_res_id_idx IS 'INDEX (res_model, res_id)';


--
-- Name: team_favorite_user_rel_user_id_team_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX team_favorite_user_rel_user_id_team_id_idx ON public.team_favorite_user_rel USING btree (user_id, team_id);


--
-- Name: theme_website_menu__page_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX theme_website_menu__page_id_index ON public.theme_website_menu USING btree (page_id) WHERE (page_id IS NOT NULL);


--
-- Name: theme_website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX theme_website_menu__parent_id_index ON public.theme_website_menu USING btree (parent_id);


--
-- Name: theme_website_page__view_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX theme_website_page__view_id_index ON public.theme_website_page USING btree (view_id);


--
-- Name: uom_uom__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX uom_uom__parent_path_index ON public.uom_uom USING btree (parent_path);


--
-- Name: uom_uom__relative_uom_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX uom_uom__relative_uom_id_index ON public.uom_uom USING btree (relative_uom_id) WHERE (relative_uom_id IS NOT NULL);


--
-- Name: utm_tag_rel_campaign_id_tag_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX utm_tag_rel_campaign_id_tag_id_idx ON public.utm_tag_rel USING btree (campaign_id, tag_id);


--
-- Name: web_tour_tour_step__tour_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX web_tour_tour_step__tour_id_index ON public.web_tour_tour_step USING btree (tour_id);


--
-- Name: website__salesteam_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website__salesteam_id_index ON public.website USING btree (salesteam_id) WHERE (salesteam_id IS NOT NULL);


--
-- Name: website_checkout_step__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_checkout_step__is_published_index ON public.website_checkout_step USING btree (is_published);


--
-- Name: website_checkout_step__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_checkout_step__website_id_index ON public.website_checkout_step USING btree (website_id);


--
-- Name: website_controller_page__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_controller_page__is_published_index ON public.website_controller_page USING btree (is_published);


--
-- Name: website_controller_page__view_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_controller_page__view_id_index ON public.website_controller_page USING btree (view_id);


--
-- Name: website_controller_page__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_controller_page__website_id_index ON public.website_controller_page USING btree (website_id);


--
-- Name: website_event_menu__event_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_event_menu__event_id_index ON public.website_event_menu USING btree (event_id) WHERE (event_id IS NOT NULL);


--
-- Name: website_lang_rel_lang_id_website_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_lang_rel_lang_id_website_id_idx ON public.website_lang_rel USING btree (lang_id, website_id);


--
-- Name: website_menu__controller_page_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_menu__controller_page_id_index ON public.website_menu USING btree (controller_page_id) WHERE (controller_page_id IS NOT NULL);


--
-- Name: website_menu__page_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_menu__page_id_index ON public.website_menu USING btree (page_id) WHERE (page_id IS NOT NULL);


--
-- Name: website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_menu__parent_id_index ON public.website_menu USING btree (parent_id);


--
-- Name: website_menu__parent_path_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_menu__parent_path_index ON public.website_menu USING btree (parent_path);


--
-- Name: website_menu__theme_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_menu__theme_template_id_index ON public.website_menu USING btree (theme_template_id) WHERE (theme_template_id IS NOT NULL);


--
-- Name: website_page__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_page__is_published_index ON public.website_page USING btree (is_published);


--
-- Name: website_page__theme_template_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_page__theme_template_id_index ON public.website_page USING btree (theme_template_id) WHERE (theme_template_id IS NOT NULL);


--
-- Name: website_page__view_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_page__view_id_index ON public.website_page USING btree (view_id);


--
-- Name: website_page__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_page__website_id_index ON public.website_page USING btree (website_id);


--
-- Name: website_rewrite__url_from_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_rewrite__url_from_index ON public.website_rewrite USING btree (url_from);


--
-- Name: website_rewrite__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_rewrite__website_id_index ON public.website_rewrite USING btree (website_id);


--
-- Name: website_sale_extra_field__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_sale_extra_field__website_id_index ON public.website_sale_extra_field USING btree (website_id) WHERE (website_id IS NOT NULL);


--
-- Name: website_snippet_filter__is_published_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_snippet_filter__is_published_index ON public.website_snippet_filter USING btree (is_published);


--
-- Name: website_snippet_filter__website_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_snippet_filter__website_id_index ON public.website_snippet_filter USING btree (website_id);


--
-- Name: website_track__page_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_track__page_id_index ON public.website_track USING btree (page_id);


--
-- Name: website_track__product_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_track__product_id_index ON public.website_track USING btree (product_id) WHERE (product_id IS NOT NULL);


--
-- Name: website_track__url_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_track__url_index ON public.website_track USING btree (url);


--
-- Name: website_track__visitor_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_track__visitor_id_index ON public.website_track USING btree (visitor_id);


--
-- Name: website_visitor__partner_id_index; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX website_visitor__partner_id_index ON public.website_visitor USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: account_account_account_auto_reconcile_wizard_rel account_account_account_auto__account_auto_reconcile_wizar_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_auto_reconcile_wizard_rel
    ADD CONSTRAINT account_account_account_auto__account_auto_reconcile_wizar_fkey FOREIGN KEY (account_auto_reconcile_wizard_id) REFERENCES public.account_auto_reconcile_wizard(id) ON DELETE CASCADE;


--
-- Name: account_account_account_auto_reconcile_wizard_rel account_account_account_auto_reconcile__account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_auto_reconcile_wizard_rel
    ADD CONSTRAINT account_account_account_auto_reconcile__account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_import_summary_rel account_account_account_import_s_account_import_summary_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_import_summary_rel
    ADD CONSTRAINT account_account_account_import_s_account_import_summary_id_fkey FOREIGN KEY (account_import_summary_id) REFERENCES public.account_import_summary(id) ON DELETE CASCADE;


--
-- Name: account_account_account_import_summary_rel account_account_account_import_summary__account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_import_summary_rel
    ADD CONSTRAINT account_account_account_import_summary__account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wiza_account_merge_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wiza_account_merge_wizard_id_fkey FOREIGN KEY (account_merge_wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wizard_re_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wizard_re_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account account_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account account_account_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account account_account_disallowed_expenses_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_disallowed_expenses_category_id_fkey FOREIGN KEY (disallowed_expenses_category_id) REFERENCES public.account_disallowed_expenses_category(id) ON DELETE SET NULL;


--
-- Name: account_account_exclude_res_currency_provision account_account_exclude_res_currency_pr_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_exclude_res_currency_provision
    ADD CONSTRAINT account_account_exclude_res_currency_pr_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_exclude_res_currency_provision account_account_exclude_res_currency_provi_res_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_exclude_res_currency_provision
    ADD CONSTRAINT account_account_exclude_res_currency_provi_res_currency_id_fkey FOREIGN KEY (res_currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_li_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_li_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_line_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_line_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_t_account_tax_repartition_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_t_account_tax_repartition_line_fkey FOREIGN KEY (account_tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_tax_rep_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_tax_rep_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag account_account_tag_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account_tag account_account_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_templat_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_templat_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_template_r_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_template_r_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: account_account_tag account_account_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_account account_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_account_account_transfer_model_line_rel account_analytic_account_acco_account_transfer_model_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_account_account_transfer_model_line_rel account_analytic_account_accou_account_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_account_account_transfer_model_line_rel
    ADD CONSTRAINT account_analytic_account_accou_account_analytic_account_id_fkey FOREIGN KEY (account_analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account account_analytic_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_account account_analytic_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_account account_analytic_account_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_account account_analytic_account_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_account account_analytic_account_root_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_root_plan_id_fkey FOREIGN KEY (root_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_analytic_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_analytic_plan_id_fkey FOREIGN KEY (analytic_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_category_id_fkey FOREIGN KEY (partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_analytic_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_general_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_general_account_id_fkey FOREIGN KEY (general_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_move_line_id_fkey FOREIGN KEY (move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_so_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_so_line_fkey FOREIGN KEY (so_line) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_line account_analytic_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_plan account_analytic_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_analytic_plan account_analytic_plan_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_analytic_plan(id) ON DELETE CASCADE;


--
-- Name: account_analytic_plan account_analytic_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_auto_reconcile_wizard_res_partner_rel account_auto_reconcile_wizar_account_auto_reconcile_wizar_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_auto_reconcile_wizard_res_partner_rel
    ADD CONSTRAINT account_auto_reconcile_wizar_account_auto_reconcile_wizar_fkey1 FOREIGN KEY (account_auto_reconcile_wizard_id) REFERENCES public.account_auto_reconcile_wizard(id) ON DELETE CASCADE;


--
-- Name: account_auto_reconcile_wizard_account_move_line_rel account_auto_reconcile_wizard_account_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_auto_reconcile_wizard_account_move_line_rel
    ADD CONSTRAINT account_auto_reconcile_wizard_account_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_auto_reconcile_wizard_account_move_line_rel account_auto_reconcile_wizard_account_auto_reconcile_wizar_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_auto_reconcile_wizard_account_move_line_rel
    ADD CONSTRAINT account_auto_reconcile_wizard_account_auto_reconcile_wizar_fkey FOREIGN KEY (account_auto_reconcile_wizard_id) REFERENCES public.account_auto_reconcile_wizard(id) ON DELETE CASCADE;


--
-- Name: account_auto_reconcile_wizard account_auto_reconcile_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_auto_reconcile_wizard account_auto_reconcile_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_auto_reconcile_wizard_res_partner_rel account_auto_reconcile_wizard_res_partner_r_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_auto_reconcile_wizard account_auto_reconcile_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizar_account_automatic_entry_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizar_account_automatic_entry_wiza_fkey FOREIGN KEY (account_automatic_entry_wizard_id) REFERENCES public.account_automatic_entry_wizard(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizard_accoun_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizard_accoun_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_selection account_bank_selection_account_online_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_selection
    ADD CONSTRAINT account_bank_selection_account_online_link_id_fkey FOREIGN KEY (account_online_link_id) REFERENCES public.account_online_link(id) ON DELETE SET NULL;


--
-- Name: account_bank_selection account_bank_selection_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_selection account_bank_selection_selected_account_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_selection
    ADD CONSTRAINT account_bank_selection_selected_account_fkey FOREIGN KEY (selected_account) REFERENCES public.account_online_account(id) ON DELETE SET NULL;


--
-- Name: account_bank_selection account_bank_selection_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attach_account_bank_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attach_account_bank_statement_id_fkey FOREIGN KEY (account_bank_statement_id) REFERENCES public.account_bank_statement(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_foreign_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_foreign_currency_id_fkey FOREIGN KEY (foreign_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_online_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_online_account_id_fkey FOREIGN KEY (online_account_id) REFERENCES public.account_online_account(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_online_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_online_link_id_fkey FOREIGN KEY (online_link_id) REFERENCES public.account_online_link(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_foreign_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line_transient
    ADD CONSTRAINT account_bank_statement_line_transient_foreign_currency_id_fkey FOREIGN KEY (foreign_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_online_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_bank_statement_line_transient
    ADD CONSTRAINT account_bank_statement_line_transient_online_account_id_fkey FOREIGN KEY (online_account_id) REFERENCES public.account_online_account(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line_transient account_bank_statement_line_transient_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_bank_statement account_bank_statement_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_cash_rounding account_cash_rounding_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_cash_rounding account_cash_rounding_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_change_lock_date account_change_lock_date_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_change_lock_date account_change_lock_date_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_change_lock_date account_change_lock_date_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_category account_disallowed_expenses_category_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_category account_disallowed_expenses_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_category account_disallowed_expenses_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_rate account_disallowed_expenses_rate_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_disallowed_expenses_rate
    ADD CONSTRAINT account_disallowed_expenses_rate_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.account_disallowed_expenses_category(id) ON DELETE CASCADE;


--
-- Name: account_disallowed_expenses_rate account_disallowed_expenses_rate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_rate account_disallowed_expenses_rate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_disallowed_expenses_rate account_disallowed_expenses_rate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_duplicate_transaction_wizard account_duplicate_transaction_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_duplicate_transaction_wizard account_duplicate_transaction_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_duplicate_transaction_wizard account_duplicate_transaction_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_financial_year_op account_financial_year_op_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_financial_year_op account_financial_year_op_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_financial_year_op account_financial_year_op_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_dest_id_fkey FOREIGN KEY (account_dest_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account_tax_rel account_fiscal_position_account_account_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_account_tax_rel
    ADD CONSTRAINT account_fiscal_position_account_account_fiscal_position_id_fkey FOREIGN KEY (account_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_src_id_fkey FOREIGN KEY (account_src_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account_tax_rel account_fiscal_position_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position account_fiscal_position_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position account_fiscal_position_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_country_group_id_fkey FOREIGN KEY (country_group_id) REFERENCES public.res_country_group(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position account_fiscal_position_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_cou_account_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_cou_account_fiscal_position_id_fkey FOREIGN KEY (account_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_country_s_res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_country_s_res_country_state_id_fkey FOREIGN KEY (res_country_state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position account_fiscal_position_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_year account_fiscal_year_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_year account_fiscal_year_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_fiscal_year account_fiscal_year_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line_res_users_rel account_followup_followup_lin_account_followup_followup_li_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_followup_followup_line_res_users_rel
    ADD CONSTRAINT account_followup_followup_lin_account_followup_followup_li_fkey FOREIGN KEY (account_followup_followup_line_id) REFERENCES public.account_followup_followup_line(id) ON DELETE CASCADE;


--
-- Name: account_followup_followup_line account_followup_followup_line_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_followup_followup_line
    ADD CONSTRAINT account_followup_followup_line_activity_type_id_fkey FOREIGN KEY (activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: account_followup_followup_line account_followup_followup_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line account_followup_followup_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line account_followup_followup_line_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line_res_users_rel account_followup_followup_line_res_users_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line account_followup_followup_line_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_followup_line account_followup_followup_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_manual_reminder_ir_attachment_rel account_followup_manual_remin_account_followup_manual_remi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_followup_manual_reminder_ir_attachment_rel
    ADD CONSTRAINT account_followup_manual_remin_account_followup_manual_remi_fkey FOREIGN KEY (account_followup_manual_reminder_id) REFERENCES public.account_followup_manual_reminder(id) ON DELETE CASCADE;


--
-- Name: account_followup_manual_reminder account_followup_manual_reminder_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_manual_reminder_ir_attachment_rel account_followup_manual_reminder_ir_attac_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_manual_reminder account_followup_manual_reminder_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_manual_reminder account_followup_manual_reminder_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_manual_reminder account_followup_manual_reminder_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_followup_manual_reminder
    ADD CONSTRAINT account_followup_manual_reminder_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_followup_manual_reminder account_followup_manual_reminder_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_missing_information_wizard account_followup_missing_information_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_followup_missing_information_wizard account_followup_missing_information_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_full_reconcile account_full_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_full_reconcile account_full_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_group account_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_group account_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_group account_group_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_group(id) ON DELETE CASCADE;


--
-- Name: account_group account_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_import_summary_account_journal_rel account_import_summary_account_j_account_import_summary_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_import_summary_account_journal_rel
    ADD CONSTRAINT account_import_summary_account_j_account_import_summary_id_fkey FOREIGN KEY (account_import_summary_id) REFERENCES public.account_import_summary(id) ON DELETE CASCADE;


--
-- Name: account_import_summary_account_journal_rel account_import_summary_account_journal__account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_import_summary_account_journal_rel
    ADD CONSTRAINT account_import_summary_account_journal__account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_import_summary_account_move_rel account_import_summary_account_m_account_import_summary_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_import_summary_account_move_rel
    ADD CONSTRAINT account_import_summary_account_m_account_import_summary_id_fkey FOREIGN KEY (account_import_summary_id) REFERENCES public.account_import_summary(id) ON DELETE CASCADE;


--
-- Name: account_import_summary_account_move_rel account_import_summary_account_move_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_import_summary_account_tax_rel account_import_summary_account_t_account_import_summary_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_import_summary_account_tax_rel
    ADD CONSTRAINT account_import_summary_account_t_account_import_summary_id_fkey FOREIGN KEY (account_import_summary_id) REFERENCES public.account_import_summary(id) ON DELETE CASCADE;


--
-- Name: account_import_summary_account_tax_rel account_import_summary_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_import_summary account_import_summary_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_import_summary_res_partner_rel account_import_summary_res_partn_account_import_summary_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_import_summary_res_partner_rel
    ADD CONSTRAINT account_import_summary_res_partn_account_import_summary_id_fkey FOREIGN KEY (account_import_summary_id) REFERENCES public.account_import_summary(id) ON DELETE CASCADE;


--
-- Name: account_import_summary_res_partner_rel account_import_summary_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_import_summary account_import_summary_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_incoterms account_incoterms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_incoterms account_incoterms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_g_account_journal_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_g_account_journal_group_id_fkey FOREIGN KEY (account_journal_group_id) REFERENCES public.account_journal_group(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_group_r_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_group_r_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal account_journal_account_online_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_account_online_account_id_fkey FOREIGN KEY (account_online_account_id) REFERENCES public.account_online_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_account_online_link_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_account_online_link_id_fkey FOREIGN KEY (account_online_link_id) REFERENCES public.account_online_link(id) ON DELETE SET NULL;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconci_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconcile_model_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconcile_model_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal account_journal_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_bank_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal account_journal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal account_journal_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal account_journal_default_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_default_account_id_fkey FOREIGN KEY (default_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal_group account_journal_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal_group account_journal_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal_group account_journal_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_journal account_journal_invoice_template_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_invoice_template_pdf_report_id_fkey FOREIGN KEY (invoice_template_pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_loss_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_loss_account_id_fkey FOREIGN KEY (loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_non_deductible_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_non_deductible_account_id_fkey FOREIGN KEY (non_deductible_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_profit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_profit_account_id_fkey FOREIGN KEY (profit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_suspense_account_id_fkey FOREIGN KEY (suspense_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_lock_exception account_lock_exception_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_lock_exception account_lock_exception_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_lock_exception account_lock_exception_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_lock_exception account_lock_exception_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_merge_wizard account_merge_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_merge_wizard account_merge_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_missing_transaction_wizard account_missing_transaction_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_missing_transaction_wizard account_missing_transaction_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_missing_transaction_wizard account_missing_transaction_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_model_rel account_model_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_model_rel
    ADD CONSTRAINT account_model_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_model_rel account_model_rel_account_transfer_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_model_rel
    ADD CONSTRAINT account_model_rel_account_transfer_model_id_fkey FOREIGN KEY (account_transfer_model_id) REFERENCES public.account_transfer_model(id) ON DELETE CASCADE;


--
-- Name: account_move__account_payment account_move__account_payment_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move__account_payment account_move__account_payment_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_sen_account_move_send_batch_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_sen_account_move_send_batch_wiza_fkey FOREIGN KEY (account_move_send_batch_wizard_id) REFERENCES public.account_move_send_batch_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_send_batch_wizar_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequen_account_resequence_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequen_account_resequence_wizard_id_fkey FOREIGN KEY (account_resequence_wizard_id) REFERENCES public.account_resequence_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequence_wizard_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


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

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


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

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


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_closing_return_id_fkey FOREIGN KEY (closing_return_id) REFERENCES public.account_return(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


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

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


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

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


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: account_move_deferred_rel account_move_deferred_rel_deferred_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_deferred_rel
    ADD CONSTRAINT account_move_deferred_rel_deferred_move_id_fkey FOREIGN KEY (deferred_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_deferred_rel account_move_deferred_rel_original_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_deferred_rel
    ADD CONSTRAINT account_move_deferred_rel_original_move_id_fkey FOREIGN KEY (original_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_extract_attachment_id_fkey FOREIGN KEY (extract_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE RESTRICT;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_cash_rounding_id_fkey FOREIGN KEY (invoice_cash_rounding_id) REFERENCES public.account_cash_rounding(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_incoterm_id_fkey FOREIGN KEY (invoice_incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_payment_term_id_fkey FOREIGN KEY (invoice_payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


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

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


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

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


--
-- Name: account_move_line account_move_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line_account_reconcile_wizard_rel account_move_line_account_reco_account_reconcile_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line_account_reconcile_wizard_rel
    ADD CONSTRAINT account_move_line_account_reco_account_reconcile_wizard_id_fkey FOREIGN KEY (account_reconcile_wizard_id) REFERENCES public.account_reconcile_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_reconcile_wizard_rel account_move_line_account_reconcile_w_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line_account_reconcile_wizard_rel
    ADD CONSTRAINT account_move_line_account_reconcile_w_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_currency_id_fkey FOREIGN KEY (company_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_followup_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_followup_line_id_fkey FOREIGN KEY (followup_line_id) REFERENCES public.account_followup_followup_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_group_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_group_tax_id_fkey FOREIGN KEY (group_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_reconcile_model_id_fkey FOREIGN KEY (reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_line account_move_line_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_line_id_fkey FOREIGN KEY (tax_line_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_tax_repartition_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_repartition_line_id_fkey FOREIGN KEY (tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


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

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


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

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


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

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


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

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


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

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


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_preferred_payment_method_line_id_fkey FOREIGN KEY (preferred_payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_move_reversal account_move_reversal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_reversal account_move_reversal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_reversal account_move_reversal_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_reversal_move account_move_reversal_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_reversal_move account_move_reversal_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_new_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_new_move_id_fkey FOREIGN KEY (new_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


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

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


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


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

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


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

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


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

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_pdf_report_id_fkey FOREIGN KEY (pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_p_account_move_send_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_p_account_move_send_wizard_id_fkey FOREIGN KEY (account_move_send_wizard_id) REFERENCES public.account_move_send_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

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


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

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
