Purge and retain data
You know what the application erases by itself, what it keeps until you delete it, and you run the annual purge that makes the period announced to staff members hold.
What erases itself
The action history, the admin sign-in log and the outcome of e-mails to staff (what is kept). JOURNAL_RETENTION (90 days by default, ISO 8601: P30D, P1Y) bounds the journal_action, journal_connexion, envoi_mail and envoi_push tables (the outcome of push notifications), which the night task purges. The devices subscribed to notifications are not purged by age: they leave with the person’s fiche or with the edition, and are withdrawn in one gesture from the space. Outside the accepted bounds, one day minimum and ten years maximum, the application refuses to start rather than silently clamp the value, as with BACKUP_RETENTION: at P0D, every night would empty the whole history.
The History page reads it; nobody writes it by hand and nothing erases it at the click of a button. The Export as CSV button of the History page (administrator only, by period) takes these lines out of the purge: the file is not erased with them, and how long it is kept is up to you, to be recorded like the tables' period. Login addresses are truncated in it. Lengthening it is a choice to own: the table goes into every backup, and it is a processing recorded in the register (what a host must keep).
What stays until you delete it
For everything else, the period of the conservation key of LEGAL_MENTIONS is shown in the privacy policy and nothing in the code enforces it. A written commitment that is not kept exposes more than no commitment: the purge is therefore done by hand, on a fixed date. This is deliberate; what automation will have to carry is written in decision 0016 (external site).
The annual purge
Once a year, after the event:
- export a dump (back up by hand) and archive it encrypted: it is the trace;
- delete, from the Editions screen, the editions whose period has expired: the cascade on
edition_idtakes staff, schedules, snapshots and tokens with them; - check that the staff space of a deleted token answers
404; - note the date and scope in the purge log.
Erasure requested during an edition
For a staff member of an edition that is still active, delete their record by hand, then the copies before a wipe of their edition that still carry it, that is all those taken before the record’s deletion: list them with GET /api/planning/sauvegardes-avant-vidage, delete them one by one with DELETE /api/planning/sauvegardes-avant-vidage/{id} (logged). The GDPR framing is in the limits to record.
These copies are never purged automatically (decision 0084 (external site)): one per wipe, unless the state is identical to the previous one, kept until the edition is deleted, which the annual purge therefore covers. Each weighs a few hundred kilobytes to a megabyte; deleting those no longer needed is an administrator’s act, through the same route.
The 3.x carpool archive
The 4.0 migration had put the carpool requests rejected or cancelled in 3.x, free-text reason included, into declaration_coequipier_avant_4_0 (what it held). 5.0 drops this table on its first start (migration V171): nothing of it remains in the database, only in the backups taken before the upgrade, until they rotate out. Note the upgrade in the register as a purge.
The 3.x publication-exclusion archive
The 4.0 migration had put into exclusion_publication_avant_4_0 the people whose last publication send was a deferral: the identifier of the person, of the edition and of the published version, and the date, with no name or free text. Same regime: 5.0 drops this table (migration V171), with the other 4.0 archives (what 5.0 drops).
The realised measure
No scheduled task computes it: the “Edition measures” screen does so on demand (ADR 0092 (external site)). The first read made once the last timeslot has ended, when something has been published, writes the measure into mesure_edition (kind REALISE): absences, replacements, empty seats and lost hours, by game category, with no person. The next edition reads it on its Versions screen and Needs tab, first computing that of every finished, published edition that has none; deleting an edition writes its own before erasing it.
The measure is written once: a correction made afterwards (an absence entered the next day) does not change it. It is not written, and the application log says so, while the frozen past is disabled (PASSE_FIGE=false). It survives the deletion of the edition, which is its purpose.
To re-freeze it after a correction that must count, there is no button: delete its rows, the next read rewrites them from the schedule as it stands.
DELETE FROM mesure_edition WHERE nature = 'REALISE' AND edition_id = '<id de l''édition>';
The id is read on the Editions screen. The deleted measure also disappears from the next edition’s Versions screen until the read that rewrites it; an edition deleted in the meantime will never be re-frozen.
A mistake, an omission? Fix this page on GitHub. (external site)