docs: migrer schémas BDD de Mermaid vers DBML
Remplace les diagrammes Mermaid par DBML (via kroki-dbml) pour une meilleure expressivité des schémas de base de données : - Ajout support notes, contraintes et indexes détaillés - Migration de tous les schémas d'entités partagées - Ajout fichier exemple dbml-example.md - Configuration plugin mkdocs-kroki pour rendu DBML
This commit is contained in:
@@ -4,29 +4,40 @@
|
||||
|
||||
## Diagramme
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
PRIVACY_POLICY_VERSIONS ||--o{ USER_POLICY_ACCEPTANCES : "acceptée par"
|
||||
USERS ||--o{ USER_POLICY_ACCEPTANCES : "accepte"
|
||||
```kroki-dbml
|
||||
Table privacy_policy_versions {
|
||||
id uuid [primary key]
|
||||
version varchar(10) [not null, unique, note: 'Format: v1.0, v2.0, etc.']
|
||||
content_markdown text [not null, note: 'Source: docs/legal/politique-confidentialite.md (versionné Git)']
|
||||
major_change boolean [not null, default: false, note: 'true = popup obligatoire pour tous les users']
|
||||
changelog text [not null, note: 'Résumé des changements pour communication']
|
||||
effective_date timestamp [not null, note: 'Date d entrée en vigueur de cette version']
|
||||
created_at timestamp [not null, default: `now()`]
|
||||
|
||||
PRIVACY_POLICY_VERSIONS {
|
||||
uuid id PK
|
||||
string version "v1.0, v2.0, etc."
|
||||
text content_markdown
|
||||
boolean major_change
|
||||
text changelog
|
||||
timestamp effective_date
|
||||
timestamp created_at
|
||||
}
|
||||
indexes {
|
||||
(version) [unique]
|
||||
(effective_date) [note: 'Order versions chronologically']
|
||||
}
|
||||
}
|
||||
|
||||
USER_POLICY_ACCEPTANCES {
|
||||
uuid id PK
|
||||
uuid user_id FK
|
||||
uuid policy_version_id FK
|
||||
boolean accepted
|
||||
timestamp accepted_at
|
||||
inet ip_address
|
||||
}
|
||||
Table users {
|
||||
id uuid [primary key]
|
||||
}
|
||||
|
||||
Table user_policy_acceptances {
|
||||
id uuid [primary key]
|
||||
user_id uuid [not null, ref: > users.id]
|
||||
policy_version_id uuid [not null, ref: > privacy_policy_versions.id]
|
||||
accepted boolean [not null, note: 'true = accepté, false = refusé (compte gelé)']
|
||||
accepted_at timestamp [not null, default: `now()`]
|
||||
ip_address inet [not null, note: 'IP de l utilisateur lors de l acceptation (preuve CNIL)']
|
||||
|
||||
indexes {
|
||||
(user_id, policy_version_id) [unique, note: 'Un user ne peut accepter qu une fois une version']
|
||||
(user_id, accepted_at) [note: 'Historique acceptations user']
|
||||
(policy_version_id) [note: 'Count acceptances par version']
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Légende
|
||||
|
||||
Reference in New Issue
Block a user