Skip to content

Commit

Permalink
refactor: station_crop_data table
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Feb 15, 2024
1 parent 7d7a057 commit 353da7e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ create table
length_upper double precision not null,
crop text not null,
label text null,
constraint crop_data_pkey primary key (variety, crop)
id bigint generated by default as identity,
constraint crop_data_pkey primary key (variety, crop),
constraint crop_data_id_key unique (id)
) tablespace pg_default;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
create table
public.climate_station_crop_data (
id bigint generated by default as identity,
created_at timestamp with time zone not null default now(),
station_id bigint not null,
water_lower double precision null,
water_upper double precision null,
length_lower double precision null,
length_upper double precision null,
crop_id bigint not null,
constraint station_crop_information_pkey primary key (id),
constraint climate_station_crop_data_station_id_fkey foreign key (station_id) references climate_stations (station_id) on delete cascade,
constraint climate_station_crop_data_crop_id_fkey foreign key (crop_id) references crop_data (id) on delete cascade
) tablespace pg_default;

0 comments on commit 353da7e

Please sign in to comment.