add unique constraints

This commit is contained in:
2025-10-29 16:45:20 +01:00
parent a5a2c5e24d
commit f1bb00ef09
2 changed files with 5 additions and 2 deletions
@@ -11,7 +11,7 @@ create table public.ingest_batch
id serial primary key,
elapsed_ms int not null default 0,
file_checksum text not null,
file_checksum text not null unique,
created_at timestamp not null default now()
);
@@ -33,7 +33,9 @@ create table public.meteo_data
rainfall numeric(5, 2) not null,
cloudiness int not null,
created_at timestamp not null default now()
created_at timestamp not null default now(),
constraint uq_meteo_data_record unique (location_name_norm, date_of_register, max_temp, min_temp, rainfall, cloudiness)
);
create index idx_meteo_data_location_name_norm on public.meteo_data (location_name_norm);