Fix missing PRAGMA's for datastore connections using SQLite

See pim-technical-roadmap#104 (closed)

Observed an issue where items where not removed from the DB after their parent collection was deleted. The problem is that SQLite requires foreign_keys's pragma to be specified for each connection to enable constraints and cascading.

This MR :

  • implements initSession that is executed after each session creation and sets all pragma's in setup that are session-bound,
  • adds a migration to ensure data will respect FK's (avoid FK errors once they are enforced)

Test :

  • e2e test passing (validating CASCADE)
  • run migration locally and confirm conflicts got deleted
Edited by Dominique MICHEL

Merge request reports

Loading
Loading