Skip to content

public.contact_documents

Columns

Name Type Default Nullable Children Parents Comment
contact_id bigint true public.contacts
created_at timestamp with time zone false
document_id bigint false public.documents
id bigint false
name varchar(255) false
salesforce_ref varchar(255) false
type varchar(20) false

Constraints

Name Type Definition
contact_documents_contact_id_579309c7_fk_contacts_id FOREIGN KEY FOREIGN KEY (contact_id) REFERENCES contacts(id) DEFERRABLE INITIALLY DEFERRED
contact_documents_document_id_38e0c794_fk_documents_id FOREIGN KEY FOREIGN KEY (document_id) REFERENCES documents(id) DEFERRABLE INITIALLY DEFERRED
contact_documents_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
contact_doc_salesfo_6e5b18_idx CREATE INDEX contact_doc_salesfo_6e5b18_idx ON public.contact_documents USING btree (salesforce_ref)
contact_doc_type_1d859b_idx CREATE INDEX contact_doc_type_1d859b_idx ON public.contact_documents USING btree (type)
contact_documents_contact_id_579309c7 CREATE INDEX contact_documents_contact_id_579309c7 ON public.contact_documents USING btree (contact_id)
contact_documents_document_id_38e0c794 CREATE INDEX contact_documents_document_id_38e0c794 ON public.contact_documents USING btree (document_id)
contact_documents_pkey CREATE UNIQUE INDEX contact_documents_pkey ON public.contact_documents USING btree (id)
unique_cv_per_contact CREATE UNIQUE INDEX unique_cv_per_contact ON public.contact_documents USING btree (contact_id) WHERE ((type)::text = 'CV'::text)

Generated by tbls