add unique constraints
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user