Skip to content

0017 use relationship table between user history and project

mvanzalu edited this page May 11, 2022 · 1 revision

17. Use relationship table between User History and Project

Date: 2022-03-14

Status

Accepted

Context

Multi project search has been previously implemented. Consequently, saving search involving multiple projects should be possible.

Decision

In terms of data persistance and database we decided to modify the USER_HISTORY table by removing the PRJ_ID column. Additionally we will create a relationship table linking user history ids and project ids in order to guarantee an N:M relationship. The new table USER_HISTORY_PROJECT will have the following constraints :

  • UNIQUE constraint between the user history id and project id to avoid unnecessary duplicates.
  • FOREIGN KEY on the user history to make sure that existing elements are bound. We will not add a FOREIGN KEY on the project id because we don't store the project ids in the database.

db_schema

Consequences

The backend will have to make multiple queries to insert or delete user history events, transactional queries will be used

Datashare

Customize (Legacy)

Translations

This project is currently available in English, French, Spanish and Japanese. You can help us to improve and complete translations on Crowdin.

About ICIJ

Datashare is a project by ICIJ, a collective of investigative journalists.

ICIJ Logo

Clone this wiki locally