From f0bee07c555640fe0a6254ad1f441406dcbb2a70 Mon Sep 17 00:00:00 2001 From: Teyras Date: Wed, 23 Nov 2016 19:23:28 +0100 Subject: [PATCH] Database corrections --- Database.md | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Database.md b/Database.md index d1f4cc0..daa2502 100644 --- a/Database.md +++ b/Database.md @@ -18,12 +18,13 @@ Assignment table represents exercise assignment in a group. It holds keys of the ## Comment -Comment entity holds one message published in arbitrary comment thread. +Comment entity holds one message published in a comment thread (standalone +comments are not permitted). - _commentThread_, _user_ -- keys of thread where this comment belongs and author of the comment - _isPrivate_ -- flag if the comment is for author only or public - _postedAt_ -- date and time of comment post -- _text_ -- actual text of the comment +- _text_ -- content of the comment ## CommentThread @@ -31,11 +32,13 @@ CommentThread entity contains all comments in one thread by one-to-many relation ## Exercise -Exercise is a structure describing one problem. Exercises can have tree structure (_exerciseId_ of parent), but now it is not used. +Exercise is a structure that describes a programming problem. Exercises can have +a tree structure (_exerciseId_ of parent) that can be used to implement an +inheritance mechanism, but it's currently not being used. - _author_ -- key for user entity of the author - _name_ -- name of the exercise -- _version_ -- version of the exercise; each edit increses this counter +- _version_ -- version of the exercise; each edit increases this counter - _createdAt_ -- date and time of creation - _updatedAt_ -- date and time of last modification - _difficulty_ -- description of difficulty, curretly used ones are easy, medium and hard @@ -92,7 +95,10 @@ GroupMembership represents relation between group and its members. Also it conta ## HardwareGroup -HardwareGroup entity represents used hardware groups by the backend. Now this table has to be changed manually when a new hardware group is added, but it is possible to automate this in the future. The hardware group has only one column with data, the textual _description_. +HardwareGroup entity represents used hardware groups by the backend. Currently +this table has to be changed manually when a new hardware group is added, but it +is possible to automate this in the future. The hardware group has only one +column with data, the textual _description_. ## HardwareGroupAvailabilityLog @@ -131,7 +137,7 @@ LocalizedAssignment entity represent text or description of the problem in one l - _name_ -- title of this localized assignment - _locale_ -- language code of locale this text is written in (for example _en_) -- _description_ -- actual text +- _description_ -- text content - _localizedAssignment_ -- key refering to parent localized assignment; when editing, new version is created as a child of the original one - _createdAt_ -- date and time of creation @@ -149,7 +155,8 @@ Permission entity holds permissions for user roles. API endpoints can have a per - _role_ -- key of the role this permission is assigned to - _resource_ -- resource name, usually same for all endpoints in one presenter; from the example above resource is _exercises_ string -- _action_ -- action, usually different for each endpoint, wildcard can be specified as _*_; from example above action is _view-all_ string +- _action_ -- action, usually different for each endpoint, wildcard can be + specified as _*_; in the example above, _view-all_ is the action - _isAllowed_ -- flag if the rule is allowed of denied ## ReferenceExerciseSolution @@ -185,11 +192,14 @@ Resource entity represent different resources used in ReCodEx system. These reso ## Role -Roles serves for distinction of what user can or cannot do. Thus every user has to have assigned some particular role from which decisions about access rights are made. +Each ReCodEx user has exactly one role. A role is associated with multiple +permissions that determine what actions can a user with that role perform on a +resource. - _id_ -- textual identification of the role - _parentRole_ -- reference to parent role -- _childRoles_ -- array of roles which have this one as parent; not actual database column, relation stored as _parentRole_ column +- _childRoles_ -- array of roles which have this one as parent; not actual + database column, relation stored using _parentRole_ column - _permissions_ -- permissions which are connected to this role; not actual database column, many-to-one relation stored in Permission entity ## RuntimeEnvironment @@ -204,7 +214,10 @@ Stores information about supported environments which can be used for evaluation ## Solution -Solution is general entity which is used for all types of evaluations, including students and reference submissions. This entity can be shared between multiple submissions (for example resubmit by supervisor). +Solution is a general entity which is used for all types of evaluations, +including students and reference solutions. This entity can be shared between +multiple submissions (for example resubmit by supervisor in case of backend +failure). - _user_ -- user key to whom this solution belongs to - _files_ -- exercise solution files which user uploaded and are associated with solution; not actual database column, one-to-many relation is stored by each file @@ -255,7 +268,9 @@ Submission entity corresponds to student submit of assignment. It stores both in ## SubmissionFailure -Logically queue of failed submissions which deserves further attention from administrator. Administrator can then resolve this issue and information about that will be stored too. +A queue of failed submissions which need further attention from the +administrator. Administrator can then resolve this issue and information about +that will be stored too. - _type_ -- type of failure, can be for example _broker_reject_ or _evaluation_failure_ - _description_ -- description of failure which was provided by backend @@ -293,7 +308,7 @@ Entity which represents one file which was uploaded to API server. This entity u ## User -Keeps information about all users which are registered in ReCodEx. +Keeps information about all users registered in ReCodEx. - _degreesBeforeName_ -- degrees before name which user acquired - _firstName_ -- first name @@ -312,7 +327,8 @@ Keeps information about all users which are registered in ReCodEx. ## UserAction -Stores information about what routes on API user visited and some additional information about it. This data should be collected only from logged users. +Stores information about what routes on API user visited and some additional +information about it. This data is collected only from logged users. - _user_ -- which user performed API request - _loggedAt_ -- date and time when action was performed