Schema: hr
English table: hr.sequence_counters
Italian original table: hr.contatori
Description: Business sequence counters for generating progressive numbers in various tables. Unlike PostgreSQL sequences, these are application-managed counters for user-visible progressive identifiers (e.g., document numbers, employee codes).
Overview
- Columns: 7
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 2
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Surrogate primary key |
sc_field_name | field_name | integer | NO | | Identifier for the counter (typically a numeric code or field reference) |
sc_current_value | field_value | integer | NO | | Current value of the counter; incremented when new numbers are generated |
sc_table_name | table_name | character varying(50) | NO | | Name of the table for which this counter generates values |
tenant_id | tenant_id | integer | YES | | Multi-tenancy identifier |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields stored as JSON |
_deleted | _deleted | boolean | YES | false | Soft delete flag for technical purposes |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_sequence_counters_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_sequence_counters → id
- Unique:
uk_sequence_counters_field_name → sc_field_name, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_sc_field_tenant | NO | btree | tenant_id, sc_field_name) WHERE (_deleted = false |
idx_sc_tenant | NO | btree | tenant_id |
Navigation