Opinio database description


Table of Contents

Introduction
Tables
OPS_SystemInfo
OPS_SystemAttribute
OPS_User
OPS_UserAttribute
OPS_UserGroup
OPS_UserGroupMember
OPS_ResourcePermission
OPS_SurveyGroup
OPS_Survey
OPS_SurveyAttribute
OPS_SurveyPage
OPS_SurveyPageAttribute
OPS_SurveyComment
OPS_SurveyPiping
OPS_Question
OPS_QuestionAttribute
OPS_QuestionTagField
OPS_QuestionRating
OPS_QuestionMultiple
OPS_QuestionMultipleOption
OPS_QuestionNumeric
OPS_QuestionMatrix
OPS_QuestionMatrixGroup
OPS_QuestionMatrixCell
OPS_QuestionFreeText
OPS_QuestionDropdown
OPS_QuestionComment
OPS_Dropdown
OPS_DropdownItem
OPS_Validator
OPS_ValidatorAttribute
OPS_BranchRating
OPS_BranchRatingOption
OPS_BranchMultiple
OPS_BranchMultipleOption
OPS_BranchNumeric
OPS_BranchDropdown
OPS_BranchDropdownOption
OPS_BranchMatrix
OPS_BranchMatrixOption
OPS_Invitation
OPS_Invitee
OPS_InviteeAttribute
OPS_Respondent
OPS_RespondentAttribute
OPS_ResponseFreeText
OPS_ResponseNumeric
OPS_ResponseEssay
OPS_ResponseEssayText
OPS_ResponseEssayNum
OPS_ResponseRating
OPS_ResponseDropdown
OPS_ResponseMultipleOption
OPS_ResponseMultipleOptionText
OPS_ResponseMultipleOptionNum
OPS_ResponseMatrix
OPS_ResponseMatrixText
OPS_ResponseMatrixNum
OPS_HeaderFooter
OPS_InvitationList
OPS_InvitationListItem
OPS_InvitationListItemAttr
OPS_Report
OPS_ReportAttribute
OPS_ReportElement
OPS_ReportElementAttribute
OPS_ReportElementQuestionNo
OPS_ReportQuestionInterval
OPS_ReportQuestionLabel
OPS_QuestionCondition
OPS_QuestionConditionOption
OPS_ReportFilter
OPS_ReportFilter_QuestionCond
OPS_ReportDrilldown
OPS_ReportRespondent
OPS_ReportFile
OPS_ReportPortal
OPS_ReportPortalAttribute
OPS_ReportPortalItem
OPS_Panel
OPS_PanelAttribute
OPS_PanelAttributeItem
OPS_PanelCategory
OPS_PanelSignUpSurvey
OPS_Panelist
OPS_PanelistAttribute
OPS_PanelistHistory
OPS_PanelUnverified
OPS_SampleDefinition
OPS_SampeCondition
OPS_SampeConditionValue
OPS_ScheduledTask
OPS_FailedEmailMsg
OPS_FailedEmailRecipient
OPS_Host
OPS_UploadedFile
OPS_UploadedFileCheck
OPS_PluginProperty
OPS_SequenceID
OPS_ContextGuideItem
OPS_RecentItem

Introduction

This documentation provides information about Opinio 6.0 database structure and description of tables, indexes and foreign keys.

Opinio database is a relational database that stores information about survey, respondent, reports and all other Opinio data. The database is total contains 101 tables.

We tried to keep Opinio databases as simple as possible to give the Opinio user a wide selection of supported databases. Opinio database doesn't rely on stored procedures, triggers, functions and other database programming features because a lot of databases don't support them.

Several sql scripts to create database are included in the Opinio distribution, one for each supported database. By supported database we mean a database that has been tested by Opinio developers and added to automatic upgrade inbuilt in Opinio.

History of database support

Opinio version Database supported
Opinio 4.0
  • Hypersonic SQL
  • MySQL
  • Microsoft SQL Server
  • Oracle
Opinio 4.1 - 5.2.11
  • Hypersonic SQL
  • MySQL
  • Microsoft SQL Server
  • Oracle
  • PostgreSQL
  • IBM DB2
Opinio 6.0
  • Derby
  • MySQL
  • Microsoft SQL Server
  • Oracle
  • PostgreSQL
  • IBM DB2

In this document we use MySQL data types to describe table columns. Column types may vary from database to database.

18. December 2007

Tables

OPS_SystemInfo

General information about the system.

Columns

Column Data type Allow NULLs Key Notes
SystemInfoId BIGINT NOT NULL PK Unique id
Language VARCHAR(100) NULL   Default language
MainMailserver VARCHAR(100) NULL   Main mail server to use when sending email
SecondMailserver VARCHAR(100) NULL   The SMTP email server to use if the main server is down
Cache_size INTEGER NULL   Survey cache size
LicenseCode VARCHAR(100) NULL   The license code controls whether Opinio runs in Demo or full mode.

Foreign keys

Foreign key Child Parent
OPS_FK78 OPS_SystemAttribute.SystemInfoId SystemInfoId
OPS_FK91 OPS_Host.SystemInfoId SystemInfoId

OPS_SystemAttribute

One record represents one system attribute.

Columns

Column Data type Allow NULLs Key Notes
SystemAttributeId BIGINT NOT NULL PK Unique id
AttributeName VARCHAR(30) NOT NULL   Short name of the system attribute
StringValue VARCHAR(255) NULL   String value of the attribute
LongValue BIGINT NULL   Long value of the attribute
BigTextValue TEXT NULL   Big text value of the attribute
FloatValue DOUBLE NULL   Double value of the attribute
SystemInfoId BIGINT NOT NULL FK References OPS_SystemInfo table

Foreign keys

Foreign key Child Parent
OPS_FK78 SystemInfoId OPS_SystemInfo.SystemInfoId

OPS_User

Defines a user.

Columns

Column Data type Allow NULLs Key Notes
UserId BIGINT Not null PK Unique id
Login VARCHAR(20) Not null   Login name
UserName VARCHAR(100) Null   User's personal name
Password VARCHAR(250) Not null   Password
EncryptionKey VARCHAR(100) Null   Encryption key

Indices

Index Columns
User_Login Login

Foreign keys

Foreign key Child Parent
OPS_FK37 OPS_ResourcePermission.UserId UserId
OPS_FK74 OPS_UserAttribute.UserId UserId
OPS_FK75 OPS_UserGroupMember.UserId UserId
OPS_FK103 OPS_Panel.UserId UserId
OPS_FK98 OPS_RecentItem.UserId UserId

OPS_UserAttribute

One record represents one user attribute.

Columns

Column Data type Allow NULLs Key Notes
UserAttributeId BIGINT Not null PK Unique id
AttributeName VARCHAR(30) Not null   Short name of the user attribute
StringValue VARCHAR(255) Null   String value of the attribute
LongValue BIGINT Null   Long value of the attribute
BigTextValue TEXT Null   Big text value of the attribute
FloatValue DOUBLE Null   Double value of the attribute
UserId BIGINT Not null FK References OPS_User table

Indices

Index Columns
UserAttribute_Us1 UserId

Foreign keys

Foreign key Child Parent
OPS_FK74 UserId OPS_User.UserId

OPS_UserGroup

Defines a group of Opinio users.

Columns

Column Data type Allow NULLs Key Notes
UserGroupId BIGINT Not null PK Unique id
UserGroupName VARCHAR(100) Null   Name of the user group
Description VARCHAR(100) Null   Description of the user group

Foreign keys

Foreign key Child Parent
OPS_FK76 OPS_UserGroupMember.UserGroupId UserGroupId

OPS_UserGroupMember

Each record maps one user to one user group. One user can be a member of unlimited number of user groups.

Columns

Column Data type Allow NULLs Key Notes
UserGroupMemberId BIGINT Not null PK Unique id
UserId BIGINT Not null FK References OPS_User table
UserGroupId BIGINT Not null FK References OPS_UserGroup table

Indices

Index Columns
UserGroupMember_1 UserId
UserGroupMember_2 UserGroupId
UserGroupMember_3 UserId, UserGroupId

Foreign keys

Foreign key Child Parent
OPS_FK75 UserId OPS_User.UserId
OPS_FK76 UserGroupId OPS_UserGroup.UserGroupId

OPS_ResourcePermission

Represents a set of permissions for a resource. Resource are reusable items, such as drop down lists, headers/footers and survey objects, such as survey group(folder), survey, report and so on. One record exists for one resource.

Columns

Column Data type Allow NULLs Key Notes
ResourcePermissionId BIGINT Not null PK Unique id
ResourceType INTEGER Null   Type of the resource:
  • 0 = all resources
  • 1 = user group
  • 2 = survey group (folder)
  • 3 = survey
  • 4 = custom report
  • 5 = dropdown list
  • 6 = header
  • 7 = footer
  • 8 = plugin
  • 9 = invitation list(reusable list of invitees)
ResourceId BIGINT Null   Id of the resource. Example: if resource type is survey, then ResourceId is survey id.
PermissionList VARCHAR(255) Null   Permissions to the resource. Stored as a string with access types separated by comma and enclosed in braces. Example: {1, 2, 7}
  • 0 - admin access
  • 1 = read access
  • 2 = modify access
  • 4 = create access
  • 5 = access to survey invitations (if ResourceType is survey)
  • 6 = access to survey reports (if ResourceType is survey)
  • 7 = permission to delete responses (if ResourceType is survey)
  • 8 = permission to add a new survey to the group (if ResourceType is survey group)
  • 9 = permission to add a new survey group to the group (if ResourceType is survey group)
  • 10 = permission to administrate users (if ResourceType is user group)
UserId BIGINT Null FK References OPS_User table

Indices

Index Columns
ResourcePermissi1 UserId
ResourcePermissi2 ResourceType, ResourceId, UserId

Foreign keys

Foreign key Child Parent
OPS_FK37 UserId OPS_User.UserId

OPS_SurveyGroup

Defines survey group.

Columns

Column Data type Allow NULLs Key Notes
SurveyGroupId BIGINT Not null PK Unique id
GroupTitle VARCHAR(100) Null   Survey group name
ParentGroupId BIGINT Null   Id of the parent survey group
Description VARCHAR(255) Null   Survey group description
SortBy INTEGER Null   Sort by value
  • 0 - name
  • 1 - date
  • 2 - date reverse
CreatedDate BIGINT Null   Created date
UpdatedDate BIGINT Null   Last updated date

Indices

Index Columns
SurveyGroup_Pare1 ParentGroupId

Foreign keys

Foreign key Child Parent
OPS_FK71 OPS_Survey.SurveyGroupId SurveyGroupId

OPS_Survey

Defines a survey. This table contains necessary information about a survey. All general information is defined in OPS_SurveyAttribute table.

Columns

Column Data type Allow NULLs Key Notes
SurveyId BIGINT Not null PK Unique id
SurveyName VARCHAR(100) Not null   Name of the survey (used in the administration module)
CreatedDate BIGINT Null   Date created
CreatedBy BIGINT Null   User id who created the survey.
SurveyGroupId BIGINT Null FK References OPS_SurveyGroup table
DeleteStatus INTEGER Null   Deleted status (not is use)
ContentType INTEGER Null   Survey content type:
  • 0 - survey is a survey
  • 1 - survey is a question library
ParentId BIGINT Null   References OPS_Survey.SurveyId. Is NULL if not a child survey.
LastEditedBy BIGINT Null   Id of the last user who has updated the survey

Indices

Index Columns
Survey_SurveyGro1 SurveyGroupId

Foreign keys

Foreign key Child Parent
OPS_FK16 OPS_Invitation.SurveyId SurveyId
OPS_FK19 OPS_Question.SurveyId SurveyId
OPS_FK34 OPS_Report.SurveyId SurveyId
OPS_FK38 OPS_Respondent.SurveyId SurveyId
OPS_FK71 SurveyGroupId OPS_SurveyGroup.SurveyGroupId
OPS_FK72 OPS_SurveyAttribute.SurveyId SurveyId
OPS_FK73 OPS_SurveyPage.surveyId SurveyId
OPS_FK87 OPS_SurveyPageAttribute.SurveyId SurveyId
OPS_FK105 OPS_PanelSignUpSurvey.SurveyId SurveyId
OPS_FK102 OPS_SurveyPiping.SurveyId SurveyId
OPS_FK94 OPS_Survey.ParentId SurveyId
OPS_FK95 OPS_SurveyComment.SurveyId SurveyId

OPS_SurveyAttribute

One record represents one survey attribute.

Columns

Column Data type Allow NULLs Key Notes
SurveyAttributeId BIGINT Not null PK Unique id
AttributeName VARCHAR(30) Not null   Short name of the attribute
StringValue VARCHAR(255) Null   String value of the attribute
LongValue BIGINT Null   Long value of the attribute
BigTextValue TEXT Null   Big text value of the attribute
FloatValue DOUBLE Null   Double value of the attribute
SurveyId BIGINT Not null FK References OPS_Survey table

Indices

Index Columns
SurveyAttribute_1 SurveyId

Foreign keys

Foreign key Child Parent
OPS_FK72 SurveyId OPS_Survey.SurveyId

OPS_SurveyPage

Represents a page with questions (survey section).

Columns

Column Data type Allow NULLs Key Notes
SurveyPageId BIGINT Not null PK Unique id
FromQuestion INTEGER Null   Number of the first question on the page
ToQuestion INTEGER Null   Number of the last question on the page
PageNo INTEGER Null   Sequential position of the page. Starts at 0.
SurveyId BIGINT Not null FK References OPS_Survey table

Indices

Index Columns
SurveyPage_Surve1 SurveyId

Foreign keys

Foreign key Child Parent
OPS_FK73 SurveyId OPS_Survey.SurveyId
OPS_FK86 OPS_SurveyPageAttribute.SurveyPageId SurveyPageId

OPS_SurveyPageAttribute

One record represents one survey page (section) attribute.

Columns

Column Data type Allow NULLs Key Notes
SurveyPageAttributeId BIGINT Not null PK Unique id
AttributeName VARCHAR(30) Not null   Short name of the attribute
StringValue VARCHAR(255) Null   String value of the attribute
LongValue BIGINT Null   Long value of the attribute
BigTextValue TEXT Null   Big text value of the attribute
FloatValue DOUBLE Null   Double value of the attribute
SurveyPageId BIGINT Not null FK References OPS_SurveyPage table
SurveyId BIGINT Not null FK References OPS_Survey table

Foreign keys

Foreign key Child Parent
OPS_FK86 SurveyPageId OPS_SurveyPage.SurveyPageId
OPS_FK87 SurveyId OPS_Survey.SurveyId

OPS_SurveyComment

Stores survey comments

Columns

Column Data type Allow NULLs Key Notes
SurveyCommentId BIGINT Not null PK Unique id
SurveyId BIGINT Not null   References OPS_SurveyId.SurveyId
CommentText TEXT Null   The survey comment
CommentBy VARCHAR(50) Null   Who added the comment
EntryDate BIGINT Null   When the comment was added

Foreign keys

Foreign key Child Parent
OPS_FK95 OPS_Survey.SurveyId SurveyId

OPS_SurveyPiping

Stores survey piping elements info

Columns

Column Data type Allow NULLs Key Notes
SurveyPipingId BIGINT Not null PK Unique id
PipingName VARCHAR(255) Not Null   The name of piping element
PipingType INTEGER Null   The piping type
  • 1 - piping of type text (the only type currently supported)
PipingSourceType INTEGER Null   The piping source type
  • 1 - question response
  • 2 - survey URL parameter
  • 3 - invitee data
  • 4 - fixed value
QuestionId BIGINT Null   Question id (set if piping source type is Question response)
QuestionSourceType INTEGER Null   Since one question can have several inputs fields, this columns specifies which of the input is used for piping.
  • 1 - in-text element
  • 2 - response to question type (rating/numeric/multiple/matrix cell/dropdown)
  • 3 - multiple Other option
  • 4 - open-ended response
IntextName VARCHAR(255) Null   The name of in-text element used for piping.
MatrixCellCol INTEGER Null   Column of the matrix cell used for piping
MatrixCellRow INTEGER Null   Row of the matrix cell used for piping
URLParamName VARCHAR(255) Null   The name of url parameter used for piping (parameter name without "opdata_").
InviteeDataType INTEGER Null   Type of the invitee data used for piping:
  • 1 - invitee name
  • 2 - invitee email
  • 3 - invitee attribute
  • 4 - invitee id
InviteeDataName VARCHAR(255) Null   The name of invitee attribute used for piping.
FixedValue VARCHAR(255) Null   Piping value for fixed value piping type
MultipleValuesDelim VARCHAR(255) Null   Delimiter for multiple piping values
SurveyId BIGINT Not null   References OPS_SurveyId.SurveyId

Indices

Index Columns
SurveyPiping1 PipingName, SurveyId

Foreign keys

Foreign key Child Parent
OPS_FK102 OPS_Survey.SurveyId SurveyId

OPS_Question

One question in a survey.

Columns

Column Data type Allow NULLs Key Notes
QuestionId BIGINT Not null PK Unique id
QuestionNo INTEGER Null   The question number
DisplayNo VARCHAR(20) Null   User defined number to display instead of default question number
QuestionText TEXT Null   Question text
QuestionType INTEGER Null   Type of the question, defines what kind of the question it is.
  • 0 - no type
  • 1 - rating
  • 2 - numeric
  • 3 - multiple
  • 4 - matrix
  • 5 - dropdown
TextBefore TEXT Null   Text before the question
TextAfter TEXT Null   Text after the question
QuestionLayout VARCHAR(10) Null   Layout of the question. Values:
  • vertical
  • horizontal
RelationKey VARCHAR(10) Null   Relation key
SurveyId BIGINT Not null FK References OPS_Survey table

Indices

Index Columns
Question1 SurveyId, QuestionNo, QuestionId

Foreign keys

Foreign key Child Parent
OPS_FK19 SurveyId OPS_Survey.SurveyId
OPS_FK20 OPS_QuestionAttribute.QuestionId QuestionId
OPS_FK22 OPS_QuestionDropdown.QuestionId QuestionId
OPS_FK23 OPS_QuestionFreeText.QuestionId QuestionId
OPS_FK24 OPS_QuestionMatrix.QuestionId QuestionId
OPS_FK28 OPS_QuestionMultiple.QuestionId QuestionId
OPS_FK30 OPS_QuestionNumeric.QuestionId QuestionId
OPS_FK31 OPS_QuestionRating.QuestionId QuestionId
OPS_FK33 OPS_QuestionTagField.QuestionId QuestionId
OPS_FK39 OPS_ResponseDropdown.QuestionId QuestionId
OPS_FK41 OPS_ResponseEssay.QuestionId QuestionId
OPS_FK43 OPS_ResponseEssayNum.QuestionId QuestionId
OPS_FK46 OPS_ResponseEssayText.QuestionId QuestionId
OPS_FK49 OPS_ResponseFreeText.QuestionId QuestionId
OPS_FK51 OPS_ResponseMatrix.QuestionId QuestionId
OPS_FK53 OPS_ResponseMatrixNum.QuestionId QuestionId
OPS_FK56 OPS_ResponseMatrixText.QuestionId QuestionId
OPS_FK59 OPS_ResponseMultipleOption.QuestionId QuestionId
OPS_FK61 OPS_ResponseMultipleOptionNum.QuestionId QuestionId
OPS_FK64 OPS_ResponseMultipleOptionText.QuestionId QuestionId
OPS_FK67 OPS_ResponseNumeric.QuestionId QuestionId
OPS_FK69 OPS_ResponseRating.QuestionId QuestionId
OPS_FK77 OPS_Validator.QuestionId QuestionId
OPS_FK79 OPS_QuestionCondition.QuestionId QuestionId

OPS_QuestionAttribute

One record for one question attribute.

Columns

Column Data type Allow NULLs Key Notes
QuestionAttributeId BIGINT Not null PK Unique id
AttributeName VARCHAR(30) Not nul