Skip to content

PostgreSQL Schema

Gregory Orton edited this page Mar 3, 2018 · 9 revisions

DB design

This is the DB diagram as of 2018/02/28:

db feb2018

Schema

See the current development schema at: https://github.com/ortonomy/fling-server/blob/development/db/schema/setup.sql

Functions

Auto-generated CRUD

CRUD functions for almost every table are auto-generated when postgraphql server is run.

Custom functions

Custom functions in the DB include:

GRANT EXECUTE ON FUNCTION flingapp.usr_register_user(text, text, text, text) to :flinganon;
GRANT EXECUTE ON FUNCTION flingapp.usr_update_user_by_id(UUID, text, text, text, UUID) to :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.usr_update_user_by_email(text, text, text, UUID) to :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.usr_delete_user_by_id(UUID) to :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.authenticate(text, text) to :flinganon;
GRANT EXECUTE ON FUNCTION flingapp.activate_user(text, text) to :flinguser;
GRANT EXECUTE ON FUNCTION flingapp.this_user() to :flinganon, :flinguser, :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.request_access_to_org(UUID, UUID) to :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.validate_org_access(TEXT, TEXT) to :flingpgql;
GRANT EXECUTE ON FUNCTION flingapp.org_request_by_requestor_id(UUID) to :flingpgql;

See schema comments in schema or use graphiql to see documentation for usage instructions

Clone this wiki locally