OJS Database diagram

Hello everyone,

I am trying to understand the database schema of OJS, in Datagrip I print out the design of the database as in this attachment, but normally I will get the relational links from table to table showing the relationship of Primary key and Foreign key however it does not show in OJS, can you please explain why so? I really appreciate any comments.

Best regards,


I am hoping it will show relation links like this database below attached:


Hi there,

I’m not familiar with Datagrip but it may be because the OJS schema does not define foreign keys in the database.


Hi all,

We currently use the third-party ADODB PHP library for our schema management, which in turn uses the AXMLS schema to describe database schema in a database-independent fashion (we support both MySQL/MariaDB and PostgreSQL). It doesn’t support explicit FOREIGN KEY constraints, unfortunately.

Alec Smecher
Public Knowledge Project Team

That makes sense!

Hi @asmecher,
is this the library ADOdb-xmlschema [ADOdb] ?

Thanks both!

Hi @dung,

Yes, that’s the one.

Alec Smecher
Public Knowledge Project Team

1 Like

would it be possible to post an ER-diagram of how the different tables relate to each other in the OJS database, or provide a link if it already exists? From time to time I get asked questions that are only able to be answered by constructing an SQL query where I have to look up in many different tables, and it is really hard and time consuming when I don’t know which tables to look up in.
Eirik Hanssen
OsloMet University Library

Hi @Eirik_Hanssen,

There is some work in progress at Setup foreign key constraints · Issue #6093 · pkp/pkp-lib · GitHub to declare foreign key relationships when installing the database. When that is done, the excellent SchemaSpy can generate comprehensive schema self-documentation.

Alec Smecher
Public Knowledge Project Team

Much overdue thanks for your response :wink: