mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
300 lines
8.1 KiB
300 lines
8.1 KiB
4 years ago
|
# Schema Public
|
||
|
|
||
|
## Tables
|
||
|
|
||
|
### audit
|
||
3 years ago
|
|
||
|
Some exercises require reviews from other students or any other member of the school. The reviewer checks that some conditions are met by the code of the student being reviewed. This process is called an `audit` and it's kept in this table.
|
||
|
|
||
4 years ago
|
Columns:
|
||
3 years ago
|
- id.
|
||
|
- groupId: The group that the audit refers to.
|
||
|
- auditorId: The user who's making the audit.
|
||
|
- attrs: The attributes of the audits keep the feedback of the auditor for each question failed.
|
||
3 years ago
|
- grade: A floating point number with the ratio between questions required to pass and questions approved. (Less than 1 means failed. More or equal than 1 means passed. More than 1 means that the student had bonus questions correct).
|
||
3 years ago
|
- createdAt: The timestamp of the time and date of creation.
|
||
|
- updatedAt: The timestamp of the last update.
|
||
3 years ago
|
- code: The code that must be used by the auditor to start the audit. This code is set to null after the audit is expired.
|
||
|
- resultId: The result of the audit. `resultId` is filled when the group has enough audits to validate or fail a project - that means that while it's not filled, audits are still "doable" (if no grade, so not done), and then after they are not needed anymore
|
||
3 years ago
|
- version: A sha of the commit that the audit refers to.
|
||
3 years ago
|
- endAt: It is used for expiration date (after this date the audit is expired).
|
||
3 years ago
|
- private: Used to access the code by the auditor.
|
||
4 years ago
|
|
||
3 years ago
|
### discordToken (TODO: remove)
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- accessToken
|
||
|
- refreshToken
|
||
|
- expiresAt
|
||
|
|
||
|
### event
|
||
3 years ago
|
|
||
|
An event anchors an objects into time.
|
||
3 years ago
|
> Note: Some [object attributes](attributes.md) are related to time, but they express time only in relative terms to the beginning of the event.
|
||
3 years ago
|
> Also, live edits (i.e., editing an event while is ongoing) it's not supported. The changes will only take effect after reloading the page.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- createdAt: The timestamp of the creation of the event.
|
||
3 years ago
|
- endAt: The timestamp for the end of the event.
|
||
3 years ago
|
- registrationId: The registration to the event.
|
||
|
- objectId: The object that is used to generate the event.
|
||
3 years ago
|
- parentId: The immediate event ancestor. The parent event.
|
||
3 years ago
|
- status: Confirmation that the event finished correctly (NULL or done for now).
|
||
|
- path: The path of the event (the relative url of the event).
|
||
|
- campus: The campus that contains the event.
|
||
3 years ago
|
- code: Used to unlock the exams.
|
||
4 years ago
|
|
||
|
### event_user
|
||
3 years ago
|
|
||
3 years ago
|
This table links users and events. A user can be in many events and an events have many users.
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- createdAt
|
||
|
- userId
|
||
|
- eventId
|
||
|
|
||
|
### group
|
||
3 years ago
|
|
||
|
Some projects are required to be made by groups. Those groups are kept in this table.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- objectId: The object that is being "done" by the group. Usually projects or raids.
|
||
|
- eventId : The groups only exist in relation to an event
|
||
|
- captainId: The captain of the group.
|
||
|
- createdAt.
|
||
|
- updatedAt.
|
||
3 years ago
|
- status: See [group_status](#group_status) for possible values.
|
||
3 years ago
|
- path.
|
||
3 years ago
|
- campus.
|
||
4 years ago
|
|
||
|
### group_status
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- status
|
||
|
Possible values (for now)
|
||
|
- `setup`
|
||
|
- `working`
|
||
|
- `audit`
|
||
|
- `finished`
|
||
|
|
||
|
### group_user
|
||
3 years ago
|
|
||
|
This table links users to groups. A user can be in many groups and a group contains many users.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- userId
|
||
|
- groupId
|
||
3 years ago
|
- confirmed: Boolean. False by default. True after the user represented by the user id confirms the group.
|
||
4 years ago
|
- createdAt
|
||
|
- updatedAt
|
||
|
|
||
|
### match
|
||
3 years ago
|
|
||
|
It is used for the `bet` system in the bonus exercises. Specifically to keep a record of the matches between students who will review and make a bet about each others code.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- createdAt
|
||
|
- updatedAt
|
||
3 years ago
|
- objectId: The object that requires the match.
|
||
|
- userId: The user that is matched.
|
||
|
- matchId: The matched that is made to another user.
|
||
3 years ago
|
- confirmed: The same as in group_user it's a way to keep track of invitations that had not been confirmed.
|
||
|
- bet: boolean; For the optional exercises that require a bet. A bet can be true if the exercises is expected to pass and false otherwise.
|
||
|
- result: boolean; True for correct bet.
|
||
4 years ago
|
- path
|
||
|
- campus
|
||
3 years ago
|
- eventId: The event the object in inserted in. (Piscine, Raid, etc).
|
||
4 years ago
|
|
||
|
### object
|
||
3 years ago
|
|
||
3 years ago
|
Objects are generic representations of elements in the structure of the curriculum (Onboarding, campus, piscine, raids, etc). They are arranged in a hierarchical structure to allow unlimited nesting (see [object_child](#object_child)). They also keep the timeline of the events relaying in durations (ex. `duration`, `eventDuration`, etc) specified by [attributes](attributes.md) (`attrs`).
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- name
|
||
3 years ago
|
- type:
|
||
|
- `onboarding`
|
||
|
- `campus`
|
||
|
- `exercise`
|
||
|
- `quest`
|
||
|
- `signup`
|
||
|
- `exam`
|
||
|
- `raid`
|
||
|
- `project`
|
||
|
- `piscine`
|
||
3 years ago
|
- status: (Currently not in used, but it should always be `online` to avoid errors TODO: remove at some point).
|
||
3 years ago
|
- `online`
|
||
|
- `offline`
|
||
|
- `draft`
|
||
3 years ago
|
- attrs: See [object attributes](attributes.md).
|
||
3 years ago
|
- childrenAttrs: Attributes that are applied to all the children objects.
|
||
4 years ago
|
- createdAt
|
||
|
- updatedAt
|
||
3 years ago
|
- externalRelationUrl (Maybe not needed).
|
||
|
- authorId (Maybe not needed).
|
||
|
- campus: The campus the object is related to.
|
||
3 years ago
|
- referenceId: If the object is a duplication this field points to the reference object.
|
||
3 years ago
|
- referencedAt: The timestamp of the creation of the copy object.
|
||
4 years ago
|
|
||
3 years ago
|
### object_child
|
||
4 years ago
|
|
||
3 years ago
|
It keeps a child-parent relationship between two objects. It's used to encapsulate objects inside each other.
|
||
4 years ago
|
|
||
|
Columns:
|
||
|
- id
|
||
|
- parentId
|
||
|
- childId
|
||
3 years ago
|
- attrs
|
||
3 years ago
|
- key: When generating the JS object this field will be the `key` of the child. It is also used in the url.
|
||
3 years ago
|
- index: Defines the position of the child object inside the parent object.
|
||
4 years ago
|
|
||
|
### progress
|
||
3 years ago
|
|
||
3 years ago
|
It is a register of the steps in the progression of students doing the exercises and projects.
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- createdAt
|
||
|
- updateAt
|
||
|
- userId
|
||
|
- groupId
|
||
|
- eventId
|
||
3 years ago
|
- version: the sha of the last commit
|
||
|
- grade: is the average of the grades of the results related to this progress if several exist.
|
||
|
- isDone: set to trure as soon as a user fails a validation or when all validations required are done.
|
||
4 years ago
|
- path
|
||
|
- campus
|
||
|
- objectId
|
||
|
|
||
|
### record
|
||
3 years ago
|
|
||
3 years ago
|
Keeps a register for the bans. It can also keep the record of other situations, this is done by setting the banEndAt to a date already passed and the reason for the record.
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- userId
|
||
|
- authorId
|
||
|
- message
|
||
|
- banEndAt
|
||
|
- createdAt
|
||
|
|
||
|
### registration
|
||
3 years ago
|
|
||
3 years ago
|
Registrations to events (For example, an exam).
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- createdAt, When the registration was created.
|
||
|
- startAt, When users can start registering to an event.
|
||
|
- endAt, When the registration ends.
|
||
3 years ago
|
- eventStartAt, Event at which the event will be started (and as such created). Event don't exist only when they start
|
||
3 years ago
|
- objectId, The object the registration refers to.
|
||
|
- parentId, The parent object of the object the registration refers to.
|
||
|
- attrs
|
||
4 years ago
|
- path
|
||
|
- campus
|
||
|
|
||
|
### registration_user
|
||
3 years ago
|
|
||
3 years ago
|
The user registered to events. A user can register to many events and and event can have many users.
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- registrationId
|
||
|
- userId
|
||
|
- createdAt
|
||
|
|
||
|
### result
|
||
3 years ago
|
|
||
|
The result for each exercise and project made in the platform.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- createdAt
|
||
|
- updatedAt
|
||
|
- grade
|
||
3 years ago
|
- attrs
|
||
3 years ago
|
- type:
|
||
|
- `tester`
|
||
|
- `user_audit`
|
||
|
- `admit_audit`
|
||
|
- `admin_selection`
|
||
|
- `status`
|
||
4 years ago
|
- userId
|
||
|
- groupId
|
||
|
- objectId
|
||
|
- path
|
||
|
- version, The version of the code the result refers to.
|
||
|
- eventId
|
||
3 years ago
|
- isLast, Used to represent transitory states. A progress is only considered finished when `isLast` is `true`.
|
||
3 years ago
|
- campus
|
||
4 years ago
|
|
||
|
### role
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- slug
|
||
4 years ago
|
- name
|
||
|
- description
|
||
|
- createdAt
|
||
|
- updatedAt
|
||
|
|
||
|
### token
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- status
|
||
|
- `active`
|
||
|
- `expired`
|
||
3 years ago
|
- createdAt
|
||
|
- updatedAt
|
||
4 years ago
|
|
||
|
### transaction
|
||
3 years ago
|
|
||
|
It's a register of the rewards given to students.
|
||
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- type:
|
||
|
- `xp`: transaction giving xp
|
||
|
- `up`: transaction correspondent to reviewing someone
|
||
|
- `down`: transaction correspondent to reviewing you
|
||
3 years ago
|
- amount:
|
||
|
- type = xp; The amount of Xp that an object rewards.
|
||
|
- type = up || down; a percentage of the change (10%);
|
||
4 years ago
|
- userId
|
||
3 years ago
|
- attrs
|
||
4 years ago
|
- createdAt
|
||
|
- path
|
||
|
- objectId
|
||
|
- eventId
|
||
|
- campus
|
||
|
|
||
|
### user
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
3 years ago
|
- githubId: (deprecated).
|
||
|
- githubLogin: alias -> login.
|
||
|
- discordId: depracated (TODO: remove)
|
||
|
- discordLogin: depracated (TODO: remove)
|
||
4 years ago
|
- profile
|
||
3 years ago
|
- attrs: Extra information about the users (email, address, etc).
|
||
4 years ago
|
- createdAt
|
||
|
- updateAt
|
||
3 years ago
|
- discordDMChannelld: depracated (TODO: remove)
|
||
4 years ago
|
- campus
|
||
|
|
||
|
### user_role
|
||
3 years ago
|
|
||
4 years ago
|
Columns:
|
||
|
- id
|
||
|
- userId
|
||
|
- roleId
|