Skip to content

Commit 0cf7d1b

Browse files
committed
Merge branch 'analytics-pipeline-partitions'
2 parents 8fc77b1 + 0a57352 commit 0cf7d1b

File tree

56 files changed

+5138
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5138
-238
lines changed

app/src/lib/database.types.ts

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,18 +2826,21 @@ export type Database = {
28262826
country_id: number
28272827
id: number
28282828
only_one_setting: boolean | null
2829+
report_partition_count: number
28292830
},
28302831
Insert: {
28312832
activity_category_standard_id: number
28322833
country_id: number
28332834
id?: never
28342835
only_one_setting?: boolean | null
2836+
report_partition_count?: number
28352837
},
28362838
Update: {
28372839
activity_category_standard_id?: number
28382840
country_id?: number
28392841
id?: never
28402842
only_one_setting?: boolean | null
2843+
report_partition_count?: number
28412844
},
28422845
Relationships: [
28432846
{
@@ -3088,6 +3091,7 @@ export type Database = {
30883091
legal_form_change_count: number | null
30893092
month: number | null
30903093
name_change_count: number | null
3094+
partition_seq: number | null
30913095
physical_address_change_count: number | null
30923096
physical_country_change_count: number | null
30933097
physical_region_change_count: number | null
@@ -3113,6 +3117,7 @@ export type Database = {
31133117
legal_form_change_count?: number | null
31143118
month?: number | null
31153119
name_change_count?: number | null
3120+
partition_seq?: number | null
31163121
physical_address_change_count?: number | null
31173122
physical_country_change_count?: number | null
31183123
physical_region_change_count?: number | null
@@ -3138,6 +3143,7 @@ export type Database = {
31383143
legal_form_change_count?: number | null
31393144
month?: number | null
31403145
name_change_count?: number | null
3146+
partition_seq?: number | null
31413147
physical_address_change_count?: number | null
31423148
physical_country_change_count?: number | null
31433149
physical_region_change_count?: number | null
@@ -3259,6 +3265,117 @@ export type Database = {
32593265
},
32603266
Relationships: []
32613267
},
3268+
statistical_history_facet_partitions: {
3269+
Row: {
3270+
births: number | null
3271+
countable_added_count: number | null
3272+
countable_change: number | null
3273+
countable_count: number | null
3274+
countable_removed_count: number | null
3275+
deaths: number | null
3276+
exists_added_count: number | null
3277+
exists_change: number | null
3278+
exists_count: number | null
3279+
exists_removed_count: number | null
3280+
legal_form_change_count: number | null
3281+
legal_form_id: number | null
3282+
month: number | null
3283+
name_change_count: number | null
3284+
partition_seq: number
3285+
physical_address_change_count: number | null
3286+
physical_country_change_count: number | null
3287+
physical_country_id: number | null
3288+
physical_region_change_count: number | null
3289+
physical_region_path: string | null
3290+
primary_activity_category_change_count: number | null
3291+
primary_activity_category_path: string | null
3292+
resolution: Database["public"]["Enums"]["history_resolution"] | null
3293+
secondary_activity_category_change_count: number | null
3294+
secondary_activity_category_path: string | null
3295+
sector_change_count: number | null
3296+
sector_path: string | null
3297+
stats_summary: Json | null
3298+
status_change_count: number | null
3299+
status_id: number | null
3300+
unit_size_change_count: number | null
3301+
unit_size_id: number | null
3302+
unit_type: Database["public"]["Enums"]["statistical_unit_type"] | null
3303+
year: number | null
3304+
},
3305+
Insert: {
3306+
births?: number | null
3307+
countable_added_count?: number | null
3308+
countable_change?: number | null
3309+
countable_count?: number | null
3310+
countable_removed_count?: number | null
3311+
deaths?: number | null
3312+
exists_added_count?: number | null
3313+
exists_change?: number | null
3314+
exists_count?: number | null
3315+
exists_removed_count?: number | null
3316+
legal_form_change_count?: number | null
3317+
legal_form_id?: number | null
3318+
month?: number | null
3319+
name_change_count?: number | null
3320+
partition_seq: number
3321+
physical_address_change_count?: number | null
3322+
physical_country_change_count?: number | null
3323+
physical_country_id?: number | null
3324+
physical_region_change_count?: number | null
3325+
physical_region_path?: string | null
3326+
primary_activity_category_change_count?: number | null
3327+
primary_activity_category_path?: string | null
3328+
resolution?: Database["public"]["Enums"]["history_resolution"] | null
3329+
secondary_activity_category_change_count?: number | null
3330+
secondary_activity_category_path?: string | null
3331+
sector_change_count?: number | null
3332+
sector_path?: string | null
3333+
stats_summary?: Json | null
3334+
status_change_count?: number | null
3335+
status_id?: number | null
3336+
unit_size_change_count?: number | null
3337+
unit_size_id?: number | null
3338+
unit_type?: Database["public"]["Enums"]["statistical_unit_type"] | null
3339+
year?: number | null
3340+
},
3341+
Update: {
3342+
births?: number | null
3343+
countable_added_count?: number | null
3344+
countable_change?: number | null
3345+
countable_count?: number | null
3346+
countable_removed_count?: number | null
3347+
deaths?: number | null
3348+
exists_added_count?: number | null
3349+
exists_change?: number | null
3350+
exists_count?: number | null
3351+
exists_removed_count?: number | null
3352+
legal_form_change_count?: number | null
3353+
legal_form_id?: number | null
3354+
month?: number | null
3355+
name_change_count?: number | null
3356+
partition_seq?: number
3357+
physical_address_change_count?: number | null
3358+
physical_country_change_count?: number | null
3359+
physical_country_id?: number | null
3360+
physical_region_change_count?: number | null
3361+
physical_region_path?: string | null
3362+
primary_activity_category_change_count?: number | null
3363+
primary_activity_category_path?: string | null
3364+
resolution?: Database["public"]["Enums"]["history_resolution"] | null
3365+
secondary_activity_category_change_count?: number | null
3366+
secondary_activity_category_path?: string | null
3367+
sector_change_count?: number | null
3368+
sector_path?: string | null
3369+
stats_summary?: Json | null
3370+
status_change_count?: number | null
3371+
status_id?: number | null
3372+
unit_size_change_count?: number | null
3373+
unit_size_id?: number | null
3374+
unit_type?: Database["public"]["Enums"]["statistical_unit_type"] | null
3375+
year?: number | null
3376+
},
3377+
Relationships: []
3378+
},
32623379
statistical_unit: {
32633380
Row: {
32643381
activity_category_paths: string[] | null
@@ -12706,6 +12823,7 @@ export type Database = {
1270612823
p_resolution?: Database["public"]["Enums"]["history_resolution"]
1270712824
p_year?: number
1270812825
p_month?: number
12826+
p_partition_seq?: number
1270912827
}
1271012828
Returns: Database["public"]["CompositeTypes"]["statistical_history_type"][]
1271112829
},
@@ -12737,6 +12855,7 @@ export type Database = {
1273712855
p_resolution?: Database["public"]["Enums"]["history_resolution"]
1273812856
p_year?: number
1273912857
p_month?: number
12858+
p_partition_seq?: number
1274012859
}
1274112860
Returns: Database["public"]["CompositeTypes"]["statistical_history_facet_type"][]
1274212861
},
@@ -13297,6 +13416,7 @@ export type Database = {
1329713416
physical_country_change_count: number | null
1329813417
physical_address_change_count: number | null
1329913418
stats_summary: Json | null
13419+
partition_seq: number | null
1330013420
},
1330113421
statistical_unit_stats: {
1330213422
unit_type: Database["public"]["Enums"]["statistical_unit_type"] | null

doc/data-model.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,12 @@ Enumerated types used across the schema, with their possible values.
160160

161161
### Derivations to create statistical_history for reporting and statistical_history_facet for drilldown.
162162

163-
- `statistical_history(unit_type, name_change_count, resolution, year, month, exists_count, exists_change, exists_added_count, exists_removed_count, countable_count, countable_change, countable_added_count, countable_removed_count, births, deaths, primary_activity_category_change_count, secondary_activity_category_change_count, sector_change_count, legal_form_change_count, physical_region_change_count, physical_country_change_count, physical_address_change_count, stats_summary)`
163+
- `statistical_history(unit_type, name_change_count, resolution, year, month, exists_count, exists_change, exists_added_count, exists_removed_count, countable_count, countable_change, countable_added_count, countable_removed_count, births, deaths, primary_activity_category_change_count, secondary_activity_category_change_count, sector_change_count, legal_form_change_count, physical_region_change_count, physical_country_change_count, physical_address_change_count, stats_summary, partition_seq)`
164164
- Enums: `resolution` (`public.history_resolution`), `unit_type` (`public.statistical_unit_type`).
165165
- `statistical_history_facet(unit_type, primary_activity_category_path, secondary_activity_category_path, sector_path, physical_region_path, name_change_count, legal_form_id, physical_country_id, unit_size_id, status_id, resolution, year, month, exists_count, exists_change, exists_added_count, exists_removed_count, countable_count, countable_change, countable_added_count, countable_removed_count, births, deaths, primary_activity_category_change_count, secondary_activity_category_change_count, sector_change_count, legal_form_change_count, physical_region_change_count, physical_country_change_count, physical_address_change_count, unit_size_change_count, status_change_count, stats_summary)`
166166
- Enums: `resolution` (`public.history_resolution`), `unit_type` (`public.statistical_unit_type`).
167+
- `statistical_history_facet_partitions(unit_type, primary_activity_category_path, secondary_activity_category_path, sector_path, physical_region_path, name_change_count, legal_form_id, physical_country_id, unit_size_id, status_id, partition_seq, resolution, year, month, exists_count, exists_change, exists_added_count, exists_removed_count, countable_count, countable_change, countable_added_count, countable_removed_count, births, deaths, primary_activity_category_change_count, secondary_activity_category_change_count, sector_change_count, legal_form_change_count, physical_region_change_count, physical_country_change_count, physical_address_change_count, unit_size_change_count, status_change_count, stats_summary)`
168+
- Enums: `resolution` (`public.history_resolution`), `unit_type` (`public.statistical_unit_type`).
167169

168170
## Import System
169171
Handles the ingestion of data from external files.
@@ -195,6 +197,7 @@ Handles background processing. A long-running worker process calls `worker.proce
195197
- `command_registry(command, created_at, handler_procedure, before_procedure, after_procedure, description, queue, batches_per_wave)`
196198
- Key FKs: queue.
197199
- `queue_registry(queue, description, default_concurrency)`
200+
- `pipeline_progress(updated_at, step, total, completed)`
198201
- `base_change_log(establishment_ids, legal_unit_ids, enterprise_ids, edited_by_valid_range)`
199202
- `base_change_log_has_pending(has_pending)`
200203

@@ -210,7 +213,7 @@ Handles background processing. A long-running worker process calls `worker.proce
210213
- `refresh_session(id, user_id, created_at, last_used_at, expires_at, jti, refresh_version, user_agent, ip_address)`
211214
- Key FKs: user_id.
212215
- `secrets(value, created_at, updated_at, key, description)`
213-
- `settings(id, activity_category_standard_id, country_id, only_one_setting)`
216+
- `settings(id, activity_category_standard_id, country_id, only_one_setting, report_partition_count)`
214217
- Key FKs: activity_category_standard_id, country_id.
215218
- `region_access(id, user_id, region_id)`
216219
- Key FKs: region_id, user_id.

0 commit comments

Comments
 (0)