Skip to main content

hr.addresses

Schema: hr
English table: hr.addresses
Italian original table: hr.recapiti
Description: Polymorphic table storing physical addresses for various entities (employees, companies, etc.) with temporal validity.

Overview

  • Columns: 20
  • Primary key: id
  • Outgoing foreign keys: 1
  • Incoming foreign keys: 0
  • Indexes: 6

Columns

English columnItalian original columnTypeNullDefault / GeneratedDescription
ididintegerNOSurrogate primary key.
addr_idrecp_idintegerNOIdentifier of the related addr record.
addr_source_tablerecp_tabellacharacter varying(10)NOName of the source table the address refers to (polymorphic reference).
addr_source_idrecp_tabella_idintegerNOID of the record in the source table.
addr_typerecp_tipocharacter varying(10)NOType of address, e.g., legal, residential, mailing.
addr_streetrecp_indirizzocharacter varying(60)NOText value.
addr_postal_coderecp_capcharacter varying(5)NOPostal or ZIP code.
addr_cityrecp_comunecharacter varying(40)NOText value.
addr_province_coderecp_provinciacharacter varying(2)NOCode for addr province.
addr_countryrecp_statocharacter varying(30)NOText value.
addr_valid_fromrecp_daldateNOBoundary value used for range filtering (start/end).
addr_notesrecp_notecharacter varying(100)NOFree-form notes.
addr_house_numberrecp_num_civicocharacter varying(10)NOText value.
addr_latituderecp_latitudinenumeric(19,15)NOAddr latitude.
addr_longituderecp_longitudinenumeric(19,15)NOAddr longitude.
tenant_idtenant_idintegerYESTenant identifier for data isolation.
colcustomcolcustomjsonbYES'{}'::jsonbJSON payload containing additional attributes.
_deleted_deletedbooleanYESfalseFlag indicating whether the record is soft-deleted.
addr_valid_torecp_aldateYESBoundary value used for range filtering (start/end).
addr_periodrecp_periododaterangeYESGENERATED: daterange(addr_valid_from, addr_valid_to, '[]'::text)Temporal range of validity (daterange) for the address.

Relationships

Outgoing foreign keys

ConstraintLocal columnsReferencesReferenced columnsOn updateOn delete
fk_addr_tenanttenant_idcloud.tenantsten_internal_idRESTRICTCASCADE

Referenced by

No incoming foreign keys found.

Constraints

  • Primary key: pk_addrid
  • Unique: uk_addr_id_tenantaddr_id, tenant_id

Indexes

NameUniqueMethodColumns / expression
idx_addr_id_tenantNObtreetenant_id, addr_id) WHERE (_deleted = false
idx_addr_period_gistNOgisttenant_id, addr_period) WHERE (_deleted = false
idx_addr_polymorphic_tenantNObtreetenant_id, addr_source_table, addr_source_id) WHERE (_deleted = false
idx_addr_source_id_tenantNObtreetenant_id, addr_source_id) WHERE (_deleted = false
idx_addr_source_period_gistNOgisttenant_id, addr_source_table, addr_source_id, addr_period) WHERE (_deleted = false
idx_addr_tenantNObtreetenant_id