TRIAL Move the mouse over tables to read the comments 1 fbkt_login Schema comments as mouse-over tooltips. Generated using DbSchema - www.dbschema.com Fk fk_license_type_application license_type ref application ( application_id -> id ) application_id Fk fk_organization_reference_referenced_organization organization_reference ref organization ( referenced_organization_id -> id ) referenced_organization_id Fk fk_organization_reference_referencing_organization organization_reference ref organization ( referencing_organization_id -> id ) referencing_organization_id Fk fk_promo_code_license_type promo_code ref license_type ( license_type_id -> id ) license_type_id Fk fk_user_login_contact user_login ref contact ( contact_id -> id ) contact_id Fk fk_license_contact license ref contact ( contact_id -> id ) contact_id Fk fk_license_status_type license ref permission ( ) Fk fk_license_type license ref license_type ( license_type_id -> id ) license_type_id Fk fk_license_organization license ref organization ( organization_id -> id ) organization_id Fk fk_license_promo_code license ref promo_code ( promo_code_id -> id ) promo_code_id Fk fk_license_permission_license license_permission ref license ( license_id -> id ) license_id Fk fk_license_permission_permission license_permission ref permission ( permission_id -> id ) permission_id Fk fk_login_token_user_login login_token ref user_login ( user_login_id -> id ) user_login_id Fk fk_facility_location facility ref location ( location_id -> id ) location_id Fk fk_facility_organization facility ref organization ( organization_id -> id ) organization_id Fk fk_organization_location organization ref location ( location_id -> id ) location_id Fk fk_contact_location contact ref location ( location_id -> id ) location_id Fk fk_contact_organization contact ref organization ( organization_id -> id ) organization_id applicationTable fbkt_login.application Pk pk_application ( id ) idid * serial Referred by license_type ( application_id -> id ) Unq application_uid_key ( uid ) uiduid * uuid default uuid_generate_v4() namename * text versionversion * text attributes_jsonattributes_json * jsonb default '{}'::jsonb require_promo_code_for_registrationrequire_promo_code_for_registration * bool default false default_new_registration_license_keydefault_new_registration_license_key * text default 'ADMIN'::text default_new_user_licensekeydefault_new_user_licensekey * text default 'USER'::text license_typeTable fbkt_login.license_type Pk pk_license_type ( id ) idid * serial Referred by license ( license_type_id -> id ) Referred by promo_code ( license_type_id -> id ) application_idapplication_id * integer References application ( application_id -> id ) namename * text license_type_keylicense_type_key * text activeactive * bool default true organization_referenceTable fbkt_login.organization_reference Pk pk_organization_reference ( id ) idid * serial referencing_organization_idreferencing_organization_id * integer References organization ( referencing_organization_id -> id ) referenced_organization_idreferenced_organization_id * integer References organization ( referenced_organization_id -> id ) organization_reference_typeorganization_reference_type * "fbkt_login"."organization_reference_type" promo_codeTable fbkt_login.promo_code Pk pk_promo_code ( id ) idid * serial Referred by license ( promo_code_id -> id ) license_type_idlicense_type_id * integer References license_type ( license_type_id -> id ) namename * text expiration_dateexpiration_date timestamp Unq promo_code_the_promo_code_key ( the_promo_code ) the_promo_codethe_promo_code * text attributes_jsonattributes_json * jsonb default '{}'::jsonb user_loginTable fbkt_login.user_login Pk pk_user_login ( id ) idid * serial Referred by login_token ( user_login_id -> id ) contact_idcontact_id * integer References contact ( contact_id -> id ) loginlogin * text hashed_passwordhashed_password * text entity_filters_jsonentity_filters_json text licenseTable fbkt_login.license Pk pk_license ( id ) idid * serial Referred by license_permission ( license_id -> id ) organization_idorganization_id * integer References organization ( organization_id -> id ) contact_idcontact_id integer References contact ( contact_id -> id ) license_type_idlicense_type_id * integer References license_type ( license_type_id -> id ) activation_dateactivation_date timestamp expiration_dateexpiration_date timestamp promo_code_idpromo_code_id integer References promo_code ( promo_code_id -> id ) attributes_jsonattributes_json * jsonb default '{}'::jsonb statusstatus * "fbkt_login"."license_status" license_permissionTable fbkt_login.license_permission Pk pk_license_permission ( id ) idid * serial license_idlicense_id * integer References license ( license_id -> id ) permission_idpermission_id * integer References permission ( permission_id -> id ) permissionTable fbkt_login.permission Pk pk_permission ( id ) idid * serial Referred by license_permission ( permission_id -> id ) namename * text login_tokenTable fbkt_login.login_token Pk pk_login_token ( id ) idid * serial user_login_iduser_login_id * integer References user_login ( user_login_id -> id ) tokentoken * uuid expiration_dateexpiration_date * timestamp locationTable fbkt_login.location Pk pk_location ( id ) idid * serial Referred by contact ( location_id -> id ) Referred by facility ( location_id -> id ) Referred by organization ( location_id -> id ) Unq location_uid_key ( uid ) uiduid * uuid default uuid_generate_v4() namename text geo_jsongeo_json jsonb geomgeom geometry address_1address_1 text address_2address_2 text citycity text countycounty text statestate text countrycountry text postal_codepostal_code text attributes_jsonattributes_json * jsonb default '{}'::jsonb facilityTable fbkt_login.facility Pk pk_facility ( id ) idid * serial organization_idorganization_id * integer References organization ( organization_id -> id ) namename * text attributes_jsonattributes_json * jsonb default '{}'::jsonb location_idlocation_id integer References location ( location_id -> id ) inactiveinactive * bool default false organizationTable fbkt_login.organization Pk pk_organization ( id ) idid * serial Referred by contact ( organization_id -> id ) Referred by facility ( organization_id -> id ) Referred by license ( organization_id -> id ) Referred by organization_reference ( referenced_organization_id -> id ) Referred by organization_reference ( referencing_organization_id -> id ) Unq organization_uid_key ( uid ) uiduid * uuid default uuid_generate_v4() namename * text attributes_jsonattributes_json * jsonb default '{}'::jsonb location_idlocation_id integer References location ( location_id -> id ) contactTable fbkt_login.contact Pk pk_contact ( id ) idid * serial Referred by license ( contact_id -> id ) Referred by user_login ( contact_id -> id ) Unq contact_uid_key ( uid ) uiduid * uuid default uuid_generate_v4() organization_idorganization_id * integer References organization ( organization_id -> id ) first_namefirst_name * text last_namelast_name * text phone_numberphone_number text emailemail text job_titlejob_title text attributes_jsonattributes_json * jsonb default '{}'::jsonb location_idlocation_id integer References location ( location_id -> id ) inactiveinactive * bool default false


Table application

Columns
* id serial
* uid uuid DEFAULT uuid_generate_v4()
* name text
* version text
* attributes_json jsonb DEFAULT '{}'::jsonb
* require_promo_code_for_registration bool DEFAULT false
* default_new_registration_license_key text DEFAULT 'ADMIN'::text
* default_new_user_licensekey text DEFAULT 'USER'::text
Indexes
pk_application ON id
application_uid_key ON uid


Table license_type

Columns
* id serial
* application_id integer
* name text
* license_type_key text
* active bool DEFAULT true
Indexes
pk_license_type ON id
Foreign Keys
fk_license_type_application ( application_id ) ref application (id)


Table organization_reference

Columns
* id serial
* referencing_organization_id integer
* referenced_organization_id integer
* organization_reference_type "fbkt_login"."organization_reference_type"
Indexes
pk_organization_reference ON id
Foreign Keys
fk_organization_reference_referenced_organization ( referenced_organization_id ) ref organization (id)
fk_organization_reference_referencing_organization ( referencing_organization_id ) ref organization (id)


Table promo_code

Columns
* id serial
* license_type_id integer
* name text
  expiration_date timestamp
* the_promo_code text
* attributes_json jsonb DEFAULT '{}'::jsonb
Indexes
pk_promo_code ON id
promo_code_the_promo_code_key ON the_promo_code
Foreign Keys
fk_promo_code_license_type ( license_type_id ) ref license_type (id)


Table user_login

Columns
* id serial
* contact_id integer
* login text
* hashed_password text
  entity_filters_json text
Indexes
pk_user_login ON id
Foreign Keys
fk_user_login_contact ( contact_id ) ref contact (id)


Table license

Columns
* id serial
* organization_id integer
contact_id integer
* license_type_id integer
  activation_date timestamp
  expiration_date timestamp
promo_code_id integer
* attributes_json jsonb DEFAULT '{}'::jsonb
* status "fbkt_login"."license_status"
Indexes
pk_license ON id
Foreign Keys
fk_license_contact ( contact_id ) ref contact (id)
fk_license_status_type ( ) ref permission ()
fk_license_type ( license_type_id ) ref license_type (id)
fk_license_organization ( organization_id ) ref organization (id)
fk_license_promo_code ( promo_code_id ) ref promo_code (id)


Table license_permission

Columns
* id serial
* license_id integer
* permission_id integer
Indexes
pk_license_permission ON id
Foreign Keys
fk_license_permission_license ( license_id ) ref license (id)
fk_license_permission_permission ( permission_id ) ref permission (id)


Table permission

Columns
* id serial
* name text
Indexes
pk_permission ON id


Table login_token

Columns
* id serial
* user_login_id integer
* token uuid
* expiration_date timestamp
Indexes
pk_login_token ON id
Foreign Keys
fk_login_token_user_login ( user_login_id ) ref user_login (id)


Table location

Columns
* id serial
* uid uuid DEFAULT uuid_generate_v4()
  name text
  geo_json jsonb
  geom geometry
  address_1 text
  address_2 text
  city text
  county text
  state text
  country text
  postal_code text
* attributes_json jsonb DEFAULT '{}'::jsonb
Indexes
pk_location ON id
location_uid_key ON uid


Table facility

Columns
* id serial
* organization_id integer
* name text
* attributes_json jsonb DEFAULT '{}'::jsonb
location_id integer
* inactive bool DEFAULT false
Indexes
pk_facility ON id
Foreign Keys
fk_facility_location ( location_id ) ref location (id)
fk_facility_organization ( organization_id ) ref organization (id)


Table organization

Columns
* id serial
* uid uuid DEFAULT uuid_generate_v4()
* name text
* attributes_json jsonb DEFAULT '{}'::jsonb
location_id integer
Indexes
pk_organization ON id
organization_uid_key ON uid
Foreign Keys
fk_organization_location ( location_id ) ref location (id)


Table contact

Columns
* id serial
* uid uuid DEFAULT uuid_generate_v4()
* organization_id integer
* first_name text
* last_name text
  phone_number text
  email text
  job_title text
* attributes_json jsonb DEFAULT '{}'::jsonb
location_id integer
* inactive bool DEFAULT false
Indexes
pk_contact ON id
contact_uid_key ON uid
Foreign Keys
fk_contact_location ( location_id ) ref location (id)
fk_contact_organization ( organization_id ) ref organization (id)

Powered by DbSchema