I created a table to keep track of which person flipped a switch at what time. It consists of:
create table records ( name varchar not null , changed_at timestamp with time zone not null , organization varchar not null , value bool not null)
To determine the latest value, I can do:
select value, name from records where organization=? order by changed_at desc limit 1;
I need to keep track of all changes to the system, hence this schema.
However, I’m considering making a separate table for organizations, and then use a foreign key constraint on
Please critique my table choice.