Skip to content

DB Schema

Brian Riley edited this page Aug 11, 2021 · 3 revisions

DB Schema

As of v3.0.1 - 2021-02-24.

Table relationships

Template and Plan table relationships:

              -------------------------------------------------------
             |                                                       |
             |n                                                      |1
 -----------------------------      ---------------        --------------------          --------------
|  answers_questions_options  |    |  annotations  |      |  question_options  |        |  conditions  |
 -----------------------------      ---------------        --------------------          --------------
   |n                                      |n                        |n                          |n
   |                                       |                         |                           |                    
   |            ---------------------------------------------------------------------------------
   |           |
   |           |1
   |     -------------              ------------              -----------              -------------              --------
   |    |  questions  |------------|  sections  |------------|   phases  |------------|  templates  |------------|  orgs  |
   |     ------------- n          1 ------------ n          1 ----------- n          1 ------------- n          1 --------
   |           |1                                                                         |     | 
   |           |               ----------------              --------                    1|     |n 
   |           |              |  contributors  |------------|  orgs  |                     -----
   |           |               ---------------- n          1 --------
   |           |                      |n
   |           |                      |
   |           |n                     |1
   |   1 -----------              ---------              ---------              ---------             --------
    ----|  answers  |------------|  plans  |------------|  roles  |------------|  users  |-----------|  orgs  |
         ----------- n          1 --------- 1          n --------- n          1 --------- n         1 --------
                                      |n
                                      |
                                      |1
                                  --------
                                 |  orgs  |
                                  --------

Themed Guidance and Plan Guidance relationships:

 --------------------              -------------
|  questions_themes  |------------|  questions  |
 -------------------- n          1 -------------
       |n
       | 
       |
       |1
   ----------                          ---------              ------------------------
  |  themes  |                        |  plans  |------------| plans_guidance_groups  |
   ----------                          --------- 1          n ------------------------
       |1                                                                |n
       |                                                                 |
       |                                                                 |
       |n                                                                |1
 ----------------------              -------------              --------------------              --------
|  themes_in_guidance  |------------|  guidances  |------------|   guidance_groups  |------------|  orgs  |
 ---------------------- n          1 ------------- n          1 -------------------- n          1 --------

Table and Column descriptions

Each table's corresponding model contains the full (and most current) details of the schema including default values, indexes and foreign key relationships.

We exclude the following generic Rails columns from the descriptions below since they are common to almost every table:

  • id (integer) - Rails' unique identifier for the record
  • created_at (datetime) - the datetime the record was created
  • updated_at (datetime) - the datetime the record was last updated (via Rails!, some of the Rake tasks and manual DB updates are not reflected here)

Annotations

The annotations table is used to store a Question's 'Example Answer' and it's question specific guidance (as opposed to themed guidance). The values in this table get displayed on the 'Write Plan' tab. An 'Example Answer' appears directly under the question's answer section. The 'Guidance' will appear on the 1st tab of the Guidance section.

Columns:

  • text (text) - The content of the example answer or guidance
  • type (integer) - Whether the content is an example_answer or guidance
  • org_id (integer) - Foreign key to the org who created the content. Typically the creator of the template or in the case of a cusotmization, the org who is customizing the template
  • question_id (integer) - Foreign key to the related question
  • versionable_id (string) - A unique id used when versioning the Template

Answers

Table that stores a DMP's answers

Columns:

  • lock_version (integer) - Used to 'lock' an answer to prevent collisions when multiple users are updating the same plan
  • text (text) - The content of the answer
  • label_id (string) - Not currently used
  • plan_id (integer) - Foreign key to the associated Plan
  • question_id (integer) - Foreign key to the associated Question
  • user_id (integer) - Foreign key to the user who last updated the content

AnswersQuestionOptions

Join table connecting Answers to their selected QuestionOptions. This table has no corresponding model.

ApiClients

System/application clients of the >= v1 API (as opposed to Org Admins)

Columns:

  • name (string) - A unique name for the client (used by the client in their 'Server-Agent' header when accessing the API)
  • homepage (string) - The system/application homepage (for reference)
  • contact_name (string) - The primary tech contact for the API integration
  • contact_email (string) - The primary tech contact's email address (the system uses this when emailing credentials)
  • client_id (string) - A unique id used to for API auth
  • client_secret (string) - A unique value used for API auth
  • last_access (datetime) - The timestamp of the client's last access to the API
  • org_id (integer) - An optional foreign key to an associated Org

ArInternalMetadata

This is a table managed by Rails

Conditions

The table that stores the config/rules for a conditional template question. For example if the user answers 'no' to a question like 'Will you preserve your data' subsequent questions like 'What repository will you deposit your data?' would be hiddden. A question can also trigger an email message for example if the user identified a repository they are going to use, an email could be sent to the repository contact letting them know that a large submission is coming their way.

Columns:

  • question_id (integer) - Foreign key to the question that triggers the condition
  • number (integer)
  • action_type (integer) - Enum value defining whether the trigger is removing questions or emailing
  • option_list (text) - the responses to the question that invoke this trigger
  • remove_data (text) - the array of subsequent question ids to be hidden/removed
  • webhook_data (text) - The email info stored as JSON

Contributors

This table stores the information of a research project's contributors (e.g. principal investigators, data curators, etc.)

Columns:

  • firstname (string) - The contributor's given name
  • surname (string) - The contributor's surname
  • email (string) - The contributor's contact email
  • phone (string) - The contributor's contact phone number (this is not shared externally)
  • roles (integer) - A Bitflag value that stores the contributor's role(s) on the project
  • org_id (integer) - Foreign key to the Org the contributor is affiliated with
  • plan_id (integer) - Foreign key to the associated Plan

Departments

Stores the departments associated with the Org. User's can associate themselves and Org Admins can associate their Users to departments

Columns:

  • code (string) - An abbreviation to identify the department
  • name (string) - The full name of the department
  • org_id (integer) - The foreign key to the parent Org

ExportedPlans

A table that logs an entry every time a user downloads their plan as a PDF.

Columns:

  • format (string) - The type of download, seems to only record 'pdf' at the moment, see note above
  • phase_id (integer) - The phase of the plan that was downloaded
  • plan_id (integer) - The associated Plan
  • user_id (integer) - The User who requested the download. Seems to always be nil, see note above.

GuidanceGroups

A way to group guidance into logical chunks. A common example would be to have an Org's primary guidance for all users in one group and then a group containing guidance that would only be applicable to a particular department or school (e.g. a medical or law school)

Columns:

  • name (string) - A name for the group. User's will see this when selecting which sets of guidance they want to see for their Plan
  • optional_subset (boolean) - Used to designate that the group is a subset of the primary group (see example above).
  • published (boolean) - Determines whether or not the User is able to select this set of guidance
  • org_id (integer) - Foreign key to the associated Org

Guidances

The table that stores 'themed' guidance. Themed guidance is guidance that is tagged to specific themes so that it is displayed next to questions that have the same theme association. For example: "Our University prefers that all biologic data is deposited in the UniBio repository" could be associated to the 'Data Preservation" theme so that it would appear next to any questions with that theme on ANY template.

Columns:

  • published (boolean) - Whether or not the guidance will be visible to the user
  • text (text) - The content of the guidance
  • guidance_group_id (integer) - The associated GuidanceGroup

IdentifierSchemes

This table is used to identify specific schemes that various identifiers are derived from (e.g. ORCID, ROR, Shibboleth, etc.). These are used in two primary scenarios: A) when an identifier has a specific pattern and is produced/managed by an external organization like ORCID (e.g. http://orcid.org/0000-0000-0000X) and B) when the identifier has special meaning or association to a service or code within the system and we need to store related information about the relationship it has to an external service (e.g. Shibboleth entityIDs). There are several Rake tasks in lib/tasks that can be used (along with the db/seeds.rb file) to populate some of these common record.

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • active (boolean) - whether or not the scheme is active (for use with scenario B outlined above)
  • description (string) - a description of the scheme for reference
  • context (integer) - Bitflag to tell how the scheme's identifiers are used: authentication (e.g. shibboleth), org identification (e.g. shibboleth or ror), plan identification (forthcoming), user identification (e.g. shibboleth or orcid), contributor identification (e.g. orcid)
  • logo_url (text) - The location of the corresponding logo.
  • name (string) - The unique name for the scheme
  • user_landing_url (string) - The landing page prefix for the identifier which will be prepended to identifiers when we do not have them. For example if the API receives an ORCID for '0000-0000-0000X' without the 'http://orcid.org/'

Identifiers

A polymorphic table that stores various external identifiers used throughout the system. This table replaces the old user_identifiers and org_identifiers

Note that it is possible to store identifiers that have no corresponding IdentifierScheme.

Columns:

  • attrs (text) - A place to store other useful information about the identifier for reference purposes
  • identifiable_type (string) - The type of model the identifier is associated with (e.g. 'Org' or 'Contributor')
  • value (string) - The value of the identifier.
  • identifiable_id (integer) - The foreign key of the associated model
  • identifier_scheme_id (integer) - The associated IdentifierScheme (optional)

Languages

This table contains the list of languages that are available for your application.

They MUST correspond with languages that you have defined/available in the config/locale and config/locales directories! See the Translations Wiki for details on how to setup specific language support.

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • abbreviation (string) - The ISO code for the language (e.g. 'fr', 'pr-BR')
  • default_language (boolean) - Identifies the default language for visitors of your site
  • description (string) - A description for reference
  • name (string) - This appears in the language selection menu (e.g. 'Português (Brasil)')

Notes

This table stores all comments made on a Plan whether it is from a collaborator or during the feedback/review process.

Columns:

  • archived (boolean) - Notes are not deleted just hidden by setting this flag
  • archived_by (integer) - The User associated with 'removing' the note
  • text (text) - The content of the comment/note
  • answer_id (integer) - The associated Answer

NotificationAcknowledgements

Join table connecting Users to the Notifications that they have acknowledged. An Notification no longer appears once the user has acknowledged it. This table has no corresponding model.

Notifications

This table stores global notification messages you can display for your users (e.g. upcoming system maintenance). The entries are managed via the Admin menu.

Columns:

  • body (text) - The message content
  • dismissable (boolean) - Whether or not the user can dismiss the message after viewing it
  • expires_at (date) - The date when the message should no longer appear to users
  • level (integer) - Dictates the color and favicon to use. The levels are info, warning, danger
  • notification_type (integer) - The audience type (currently only supporting global notifications)
  • starts_at (date) - The date when the message should start appearing to users
  • title (string) - A title for reference purposes in the Admin screen
  • enabled (boolean) - A flag to quickly disable a notification message

OrgTokenPermissions

Join table connecting Orgs to their TokenPermissionTypes. This table has no corresponding model.

Orgs

The primary table that stores information about an organization whether they are a university or a funder.

Managed Orgs are ones that have Administrators. A managed org can have templates, guidance, a logo, contact info, etc. This field replaces the old is_other flag. When a user selects (or types) a new Org from the ROR API, the system will create a new Org record that is un-managed. A super admin can switch the Org to a managed org when necessary, and then promote the user(s) to be org admins.

The org_type bitflag can have any combination of several values. Two of those values though contain special significance with regard to some of the system functionality:

  • Funder: Allows the org to create templates and guidance that appear on the public facing 'Funder Requirements' page. They also will appear in the list of 'Funders' the user can select from when creating or updating their Plan. A funder's templates are customizable by other Orgs.
  • Institution: This is the standard type used to define a Research Institution. This will ensure the Org appears in the list of 'Research Institutions' the user can select from when creating a Plan.

Columns:

  • abbreviation (string) - An abbreviation for the Org. This is used when displaying guidance
  • contact_email (string) - The Org's helpdesk email displayed at the top of the page in the Org branding section of the header
  • contact_name (string) - The Org's helpdesk name displayed at the top of the page in the Org branding section of the header
  • feedback_email_msg (text) - The message displayed to users after they request feedback. (Used to be an email but now just displayed
  • feedback_email_subject (string) - The old email subject. no longer used
  • feedback_enabled (boolean) - Whether or not the Org's users can request feedback for the Plan
  • is_other (boolean) - An old flag used to define whether an Org was managed (see above) no longer used
  • links (text) - Additional links to display for the user at the top of the page in the Org branding section of the header
  • logo_name (string) - The logo's original name from the upload process
  • logo_uid (string) - The logo's id provided by the Dragonfly gem
  • managed (boolean) - A flag that controls system functionality (see above)
  • name (string) - The Org's name
  • org_type (integer) - A bitflag containing the organization types which controls functionality (see above)
  • sort_name (string) - The name of the organization used for sorting. no longer in use
  • target_url (string) - The link to the organizations home page displayed at the top of the page in the Org branding section of the header
  • language_id (integer) - This is meant to dictate the default language for the Org's users (overriding the system default defined in the languages table)
  • region_id (integer) - The Org's region which has not been implemented yet.

Perms

A table storing the various permissions the system uses to define user authorization

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • name (string) - a unique name for the permission

Phases

A table storing information about a phase of a template. A phase is a logical division of a template (see diagram above)

Columns:

  • description (text) - A description of the phase
  • modifiable (boolean) - Indicates whether or not the phase is part of the original funder template when customizing.
  • number (integer) - The cardinality of the phase used to determine it's display order
  • title (string) - A title for the phase used to name the tab on the Write Plan pages
  • template_id (integer) - The foreign key to the associated parent template
  • versionable_id (string) - A unique identifier used for template versioning

Plans

The table that stores the top level information about a DMP (aka Plan).

Explanation of DMP visibilities:

  • Public: Anyone can view or download the DMP. DMPs with this visibility appear on the public facing 'Public DMPs' page
  • Private: Only the owner/creator of the DMP and any collaborators (or Admins during the feedback process) can access the DMP. These DMPs appear on the main table of the 'My Dashboard' page
  • Organizational: Provides the private visibility rules + any other User from the same Org can download the plan as a PDF. These appear on the organization DMP table at the bottom of the 'My Dashboard' page

When the feedback_enabled flag is set, Org Admins for the owner's Org will see a link to the DMP on their 'My Dashboard' page

Columns:

  • complete (boolean) - A flag indicating whether or not the minimum percentage of questions has been answered (min % value is defined in config initializer)
  • data_contact (string) - No longer used info now in the contributors table no longer used
  • data_contact_email (string) - No longer used info now in the contributors table no longer used
  • data_contact_phone (string) - No longer used info now in the contributors table no longer used
  • description (text) - The DMP abstract
  • feedback_requested (boolean) - A flag indicating whether the DMP is in the feedback request workflow. Set to true when user requests feedback and false once the Admin has completed the process
  • funder_name (string) - No longer used replaced by fkey to Orgs table via funder_id column no longer used
  • grant_number (string) - No longer used replaced by fkey to Identifiers table via grant_id column no longer used
  • identifier (string) - Used to store an identifier that is useful to the user (e.g. an internal Univ. grant office id, etc.)
  • principal_investigator (string) - No longer used info now in the contributors table no longer used
  • principal_investigator_email (string) - No longer used info now in the contributors table no longer used
  • principal_investigator_identifier (string) - No longer used info now in the contributors table no longer used
  • principal_investigator_phone (string) - No longer used info now in the contributors table no longer used
  • title (string) - The DMP title
  • visibility (integer) - The DMP's level of visibility, either private, organizational or public (see above)
  • template_id (integer) - Foreign key to the Template that the DMP's answers are mapped to
  • org_id (integer) - Foreign key to the Org that represents the Research Institution the DMP belongs to
  • funder_id (integer) - Foreign key to the Org table representing the Funder
  • grant_id (integer) - Foreign key to the Identifiers table containing the Grant ID/URL
  • api_client_id (integer) - Foreign key to an ApiClient (optional and only populated if the ApiClient created the DMP)

PlansGuidanceGroups

Join table connecting Plans to their GuidanceGroup selections. This table has no corresponding model.

Prefs

This table contains a Use's email notification preferences.

Columns:

  • settings (text) - JSON hash of notification prefs
  • user_id (integer) - Foreign key to the associated User

QuestionFormats

This table allows us to define question types available to an Admin when creating/editing a template. The information in this table helps drive the UI functionality and logic.

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • description (text) - A description of the type for reference
  • formattype (integer) - A unique id for the type
  • option_based (boolean) - Whether or not the question has associated question options
  • title (string) - A unique name for the type (e.g. Checkbox, Text Area, etc.)

QuestionOptions

This table stores all of the various options for a Question whose QuestionFormat has the option_based flag set to true (e.g. a Checkbox, Select box, etc.)

Columns:

  • is_default (boolean) - Whether or not the option is the default selection. Note there does not need to be a default
  • number (integer) - The cardinality of the option
  • text (string) - The label to display for the option
  • question_id (integer) - Foreign key to the assoiciated Question

Questions

Stores a template's questions

Columns:

  • default_value (text) - The default response to the question (optional)
  • modifiable (boolean) - Whether or not the question can be modified. This is used to safeguard the original funder's questions when an org admin is customizing a template
  • number (integer) - The cardinality of the question within it's Section
  • option_comment_display (boolean) - Flag indicating whether a user can provide additional comments. This is typically used in conjunction with option based questions like a yes/no answer.
  • text (text) - The text of the question
  • question_format_id (integer) - Foreign key to the associated QuestionFormat
  • section_id (integer) - Foreign key to the parent Section
  • versionable_id (string) - A unique identifier used for versioning of Templates

Regions

This table stores information about available regions. The functionality for this has not been implemented. It will be used to help tailor content for Users. For example if a country specific region is added, then we could add the region_id to Orgs and Templates so that when a user is creating a new DMP they are only shown funders and templates within their region.

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • abbreviation (string) - A unique abbreviation for the region
  • description (string) - A description of the region for reference
  • name (string) - The name of the region

ResearchOutputs

This table is currently in active development and subject to change. It has no corresponding UI functionality at the moment. It will eventually have a tab on the Write Plan pages that allow a user to identify various intended research outputs for their DMP.

Columns:

  • abbreviation (string) - An abbreviation for the output for reference when answering questions
  • access (integer) - The initial access level (e.g. open, embargoed, restricted, etc.)
  • byte_size (bigint) - The anticipated size of the output in bytes
  • coverage_end (datetime) - no longer used
  • coverage_region (string) - no longer used
  • coverage_start (datetime) - no longer used
  • description (text) - A description of the output
  • display_order (integer) - The cardinality of the output when displaying in the UI or downloads
  • is_default (boolean) - Whether or not the output is the default selection if a question allows the user to specify specific outputs
  • mandatory_attribution (text) - no longer used
  • output_type (integer) - The type of output (e.g. dataset, software, data paper, etc.)
  • output_type_description (string) - A field to allow the user to specify another type. Only applicable if they select 'other' for output_type
  • personal_data (boolean) - Flag indicating whether or not the output will contain personally identifiable information (PII)
  • release_date (datetime) - The anticipated release/publication date
  • sensitive_data (boolean) - A flag indicating whether or not the output will contain sensitive information
  • title (string) - The title for the output
  • mime_type_id (integer) - no longer used
  • plan_id (integer) - Foreign key to the associated Plan

Roles

This table identifies which users are collaborating on a Plan and what their respective access levels are for that Plan.

These records are never actually deleted, their 'active' flag is just set to false. This is to ensure that the relationship to the authors is not lost because that is important historical information. When the active flag is set to false the user will no longer see the Plan on their 'My Dashboard' page. They will still be listed as an author though when others access or download the plan.

The available Roles are:

  • Creator: the user who created the plan
  • Administrator: someone who has full access to the plan. These users can provide access to other users, edit the plan, add contributors, etc.
  • Editor: someone who can edit the plan and its contributors but cannot invite other collaborators
  • Commenter: someone who can only comment on the plan's answers
  • Reviewer: a special designation for an Org Admin allowing them to comment on the plan within the feedback workflow.

Columns:

  • access (integer) - A bitflag representing the user's access permissions
  • active (boolean) - Whether or not the user will have access to the Plan in the UI.
  • plan_id (integer) - The foreign key to the associated Plan
  • user_id (integer) - The foreign key to the associated User

SchemaMigrations

This is a table that records which DB migrations have been processed. It is managed by Rails.

Sections

A logic grouping of questions within a template's phase

Columns:

  • description (text) - A description of the types of questions within the section
  • modifiable (boolean) - A flag used when working with a customized template. When modifiable is false it indicates that the section is from the original funder template and cannot be modified.
  • number (integer) - The cardinality of the section within the phase
  • title (string) - A title for the Section
  • phase_id (integer) - Foreign key to the parent Phase
  • versionable_id (string) - A unique identifier used for versioning of Templates

Sessions

This is a table storing user session info. It is managed by Rails.

Settings

A polymorphic table used to store the formatting settings (e.g. Font, margins, etc.) used when a user downloads the PDF version of their DMP.

Columns:

  • var (string) - the type of setting. In our case this is always 'export'
  • value (text) - a tab delimited representation of the settings
  • target_id (integer) - the foreign key to the ExportedPlan record
  • target_type (string) - the foreign relation type. In our case this is always 'ExportedPlan'

Stats

A polymorphic table used to store statistical metrics. The data is populated via a Rake task which should be run on the first day of each month. The various record types are:

  • StatCreatedPlan: The number of Plans created for the Org for the given month. Includes the breakdown by template.
  • StatJoinedUser: The number of Users who joined for the Org for the given month
  • StatExportedPlan: The number of Plans that were downloaded for the Org for the given month
  • StatSharedPlan: The number of Plans that were shared with collaborators for the Org for the given month

Columns:

  • count (bigint) - The number of times that [type] happened
  • date (date) - the Date as 'yyy-mm-dd'
  • details (text) - Additional JSON details. Currently nil or a hash of the template breakdowns
  • filtered (boolean) - Whether or not test Plans are included in the count
  • type (string) - The type of record (see above)
  • org_id (integer) - Foreign key to the associated Org

Templates

The primary table for a DMP template.

Warning: there should only be ONE default template. The default template is used when the user creates a Plan and specifies a Research Institution that has no template and Funder who has no template.

Published: When a template is published it becomes available when a user creates a Plan.

If an Org Admin alters a published template, a new version of the template is created. The original published version remains in place and is the one a user receives when creating a new plan until the Admin publishes the new version. There are visual icons on the Templates page to help admins understand when their template is in this state. There can be only ONE published version of a template at any given time.

A plan's template association does not change when versioning of a template occurs. The plan retains the version that was available when they created the template.

You can see which version of a template a plan has at the top of the 'Write Plan' page

If the Org is a funder and any other Orgs have customized the funder's template, then they are notified of the new version and provided with a button and screen to help them transfer over the updated changes into a new version of their custommization.

Columns:

  • archived (boolean) - When a template is 'deleted' it is not actually removed unless there are no plans associated with it. If it has associated plans, this flag is set to true so that it can no longer be used but it's content is still available when viewing or downloading plans
  • customization_of (integer) - When populated it designates that the template is a customization of another template. The value is the other template's family_id
  • description (text) - A description for the template
  • is_default (boolean) - Whether or not this is the default template
  • links (text) - Sample plan and other information links. These are displayed on the guidance tab when editing a plan and also as links on the public facing 'Funder Requirements' page
  • locale (string) - The language of the template Not currently in use
  • published (boolean) - Whether or not the template is available to the users when creating new plans (see above).
  • title (string) - The title of the template
  • version (integer) - The version identifier
  • visibility (integer) - Whether or not the template is available to the public or only to users of that Org. This is applicable only for scenarios where the Org is a funder as well as a research institution. This allows them to designate templates for the general public and ones that target their internal users
  • family_id (integer) - A unique identifier used to connect template versions and customizations
  • org_id (integer) - Foreign key to the associated Org

Themes

Themes allow generic guidance to be associated with specific questions. For example the 'Data Preservation' theme could be used to tie guidance about preferred repositories to a templates question about how the user intends to preserve their data.

Columns:

  • description (text) - A longer description for the theme
  • locale (string) - The language This is not currently in use
  • title (string) - A title for the theme which is display to the admin when creating questions/guidance

ThemesInGuidance

Join table connecting Guidance to their Themes. This table has no corresponding model.

TokenPermissionTypes

A table used to associate an Org and the API permissions that their user's are allowed to access. This is only applicable to Users connecting the API. ApiClients have different permission rules that will be defined via a 'subscriptions' table.

The values in this table must be managed manually. There are no associated UI screens

Columns:

  • text_description (text) - A description of the type of permission being granted
  • token_type (string) - A unique name for the permission

Trackers

This table stores Google analytics tracker codes. It allows an Org to get analytics about their user's activity on the site.

Columns:

  • code (string) - The GA code
  • org_id (integer) - Foreign key to the associated Org

Users

A table that stores User information.

Columns:

  • accept_terms (boolean) - Whether or not the User accepted the terms and conditions on sign up. The account is invalid until this is true
  • active (boolean) - A flag that allows you to disable a user's account
  • api_token (string) - The User's API token
  • confirmation_sent_at (datetime) - The datetime the Devise confirmation email was sent. Not currently used
  • confirmation_token (string) - The Devise confirmation token. Not currently used
  • confirmed_at (datetime) - The datetime the Devise confirmation token was verified. Not currently used
  • current_sign_in_at (datetime) - The user's current sign in timestamp managed by the Devise gem
  • current_sign_in_ip (string) - The user's current IP managed by the Devise gem
  • email (string) - The usuer's unique email address
  • encrypted_password (string) - The password encrpyted by the Devise gem
  • firstname (string) - The user's first name
  • invitation_accepted_at (datetime) - The timestamp that the user accepted the Devise gem's invitation to sign up
  • invitation_created_at (datetime) - The timestamp that the Devise gem's invitation was created
  • invitation_sent_at (datetime) - The timestamp that the Devise gem's invitation was emailed
  • invitation_token (string) - The Devise gem's invitation token
  • invited_by_type (string) - The type of invitiation managed by the Devise gem
  • last_sign_in_at (datetime) - The user's last sign in timestamp managed by the Devise gem
  • last_sign_in_ip (string) - The user's last sign in IP address managed by the Devise gem
  • other_organisation (string) - Used to hold the user's unmanaged Org name no longer used
  • recovery_email (string) - The user's account recovery email address
  • remember_created_at (datetime) - The timestamp of when the user clicked 'remember me' managed by the Devise gem
  • reset_password_sent_at (datetime) - The timestamp of when the Devise gem sent out the password reset email
  • reset_password_token (string) - The password reset token generate by the Devise gem
  • sign_in_count (integer) - The number of times the user has logged in managed by the Devise gem
  • surname (string) - The user's last name (family name)
  • department_id (integer) - Foreign key to the Department
  • invited_by_id (integer) - Foreign key to the User who initiated the invitation
  • language_id (integer) - The user's default language setting
  • org_id (integer) - Foreign key to the associated Org

UsersPerms

Join table connecting Users to their Permissions. This table has no corresponding model.

Clone this wiki locally