Skip to content

db schema

JP edited this page Feb 4, 2020 · 8 revisions

The mcorpus database is a Postgres database. It can be divided into two 'sub-schemas':

  • mcuser sub-schema The gatekeeper for mcorpus data access. Login and logout on behalf of a known mcuser is required before any mcorpus data may be queried or mutated.
  • member sub-schema The actual corpus of member data exposed by this api.

The full DDL for the mcorpus database is here.

mcuser sub-schema

The tables and db objects enabling user authentication for access to the mcorpus api.

mcuser sub-schema

mcuser table

Each mcuser record represents a pre-defined user that is allowed to access the mcorpus api. An mcuser is able to login and logout. Only logged-in mcusers are able to interact with the api.

mcuser_audit table

An mcuser_audit record is created when an mcuser does one of the following:

  • Login
  • Logout

mcuser_status

User defined db type to constrain the allowed values for the mcuser.status column.

mcuser_audit_type

User defined db type to constrain the allowed values for the mcuser_audit.type column.

jwt_id_status

User defined db type to constrain the allowed values for the mcuser_audit.jwt_id_status column.

member sub-schema

This part of the mcorpus db schema holds the actual corpus of member data that is accessed through the GraphQL api once an mcuser has logged in.

member sub-schema

member

The primary member table comprised of the member primary key UUID, name and member status.

muth

Related one table to the member table holding member PII (Personally Identifiable Information) related fields. Namely: dob, email, phone, username and password.

member_audit

Logs when a member logs in or out along with the http request origin and request timestamp.