Open underbluewaters opened 4 years ago
created
and last_updated
timestamp fields?
@underbluewaters @wmcclin re: sectors. my intuition is that a customizable list might better since there I've seen some variation across the places we work (Maldives sector list is slightly different than Bermuda, for example) and people like to feel like their identity or livelihood is included. However, if it seems like there has been a pretty standard "core" list of sectors across all the projects you guys have done then I think a standard is fine, especially if it simplifies things. Happy to help develop a standard list, or at least a list of defaults - I'll default to whatever timeline you feel is adequate
I agree. I think we need to have a customizable list. I would include the following as defaults:
Implementing this gets fairly complex so I'm going to punt on it for now. We'll need a few tables, to hold default sectors, to hold project-specific sectors, triggers to copy the defaults on project creation, and a ui for admins to manage their stuff. Something like:
create table default_user_sectors (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name text not null
);
create table project_user_sectors (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
project_id integer NOT NULL UNIQUE REFERENCES projects (id) ON DELETE CASCADE,
name text not null
);
create table users_project_user_sectors (
user_id integer NOT NULL UNIQUE REFERENCES users (id) ON DELETE CASCADE,
project_user_sector_id integer NOT NULL UNIQUE REFERENCES project_user_sectors (id) ON DELETE CASCADE,
);
# store whether a user has selected their sectors, since their choice could be "nothing"
create table users_has_selected_project_user_sectors (
user_id integer NOT NULL UNIQUE REFERENCES users (id) ON DELETE CASCADE,
project_id integer NOT NULL UNIQUE REFERENCES projects (id) ON DELETE CASCADE,
made_choices boolean not null default true
);
Basic profiles
I've added a basic user profile that incorporates standard openid info that is coming from our authentication provider, as well as some fields carried over from the SeaSketch legacy db. So far it looks like this:
https://github.com/seasketch/next/blob/master/packages/db/migrations/committed/000004.sql
I'm looking for some feedback on whether this is adequate. Keep in mind how PII will have to be treated to comply with GDPR and other similar regulations. All of this information is optional.
Sectors
We've briefly discussed having users categorize themselves by indicating which "sectors" they identify with. Are they a fisher, scientist, policy maker, etc? There are few outstanding questions about how we implement this.