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,
Dung.

diagram

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

expected

Hi there,

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

Cheers,
Jason

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.

Regards,
Alec Smecher
Public Knowledge Project Team

That makes sense!

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

Thanks both!
Dung.

Hi @dung,

Yes, that’s the one.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hello,
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.
Best,
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.

Regards,
Alec Smecher
Public Knowledge Project Team

Much overdue thanks for your response :wink: