Skip to main content

Maintaining the Database

Current uses a local SQLite database to store data, divided into two database files:

/backend/orion.db
- users: Stores user data
- sessions: Stores active sessions of currently logged-in users
- permissions: Stores user permissions
- configuration: Stores system configuration (e.g., announcements)
- auditlog: Stores operation logs
/backend/current.db
- issues: Stores journal data
- entries: Stores manuscript data
- sudo: Specifically stores active sessions of super administrators in the management panel
info

Since Current is still under development, the management panel functionalities are not fully implemented yet. Therefore, some management operations require you to directly operate on the SQLite database.

You will need a SQLite database editor software (such as Navicat, JetBrains DataGrip, DB Browser for SQLite) to manipulate the database.

Managing Users

User data is stored in the users table of orion.db.

Column NameTypeDescription
idINTEGERUser ID
nameTEXTUsername
passwdTEXTPassword (SHA-256 encrypted)
gradeTEXTUser Grade
classnumTEXTUser Class
activeTEXTActive Status (true or false)

You can add, delete user data, or reset passwords by directly editing the users table.

tip

The SHA-256 encrypted value for the password 123456 is 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92. You can use this value to reset passwords for other users.

How to calculate SHA-256? Visit SHA-256 Calculator.

Managing User Permissions

User permissions are stored in the permissions table of orion.db.

Column NameTypeDescription
targetTEXTPermission Target
nodeTEXTPermission Node Name

Permissions are stored in the form of permission nodes, and nodes starting with group. have inheritable properties.

For regular users, it is necessary to grant the group.default permission (which includes basic permissions such as client.login and client.changepass), otherwise, the user cannot log in (this mechanism can also be used to ban accounts).

For administrators, you can directly grant the * permission, which includes all permissions.

Managing Journals

Journal data is stored in the issues table of current.db.

Column NameTypeDescription
idINTEGERJournal ID
dateINTEGERJournal Deadline Date (Unix Timestamp)
subject2TEXTTitle of the 2nd Edition
subject3TEXTTitle of the 3rd Edition
subject4TEXTTitle of the 4th Edition
leaderTEXTChief Editor (currently unused)
editorsTEXTJournal Editors stored as a [...] list (currently unused)
respeditorTEXTResponsible Editor (currently unused)
ispublishedINTEGERWhether the Journal is Published (0 for unpublished, 1 for published)

You can create new journals directly on the front end at /newissue.

Managing Manuscripts

Manuscript data is stored in the entries table of current.db.

Column NameTypeDescription
uuidTEXTManuscript UUID
issue_idINTEGERJournal ID
filenameTEXTOriginal File Name of the Manuscript
pageINTEGERPage Number of the Manuscript
titleTEXTTitle of the Manuscript
originTEXTOrigin of the Manuscript
wordcountINTEGERWord Count of the Manuscript
descriptionTEXTDescription of the Manuscript
selectorTEXTManuscript Selector
reviewerTEXTManuscript Reviewer
statusTEXTStatus of the Manuscript

Most manuscript data can be managed on the front end at /issue/[issue_id], but data like reviewers and selectors need to be manually edited in the database.

To ensure server safety, uploaded files do not retain their original names but are renamed to the manuscript UUID, and they can be found in the /backend/uploads directory.

The general manuscript statuses are: created for created manuscripts, reviewed for reviewed manuscripts, and selected for selected manuscripts.

Manuscripts with a status of pending might have encountered issues like connection loss during upload. In most cases, these can be ignored or deleted.