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,26 +4,67 @@
|
||||
|
||||
## Diagramme
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
USERS ||--o{ REPORTS : "signale"
|
||||
CONTENTS ||--o{ REPORTS : "reçoit"
|
||||
USERS ||--o{ REPORTS : "modère"
|
||||
```kroki-dbml
|
||||
Table users {
|
||||
id uuid [primary key]
|
||||
username varchar(50)
|
||||
}
|
||||
|
||||
REPORTS {
|
||||
uuid id PK
|
||||
uuid content_id FK
|
||||
uuid reporter_id FK
|
||||
uuid moderator_id FK
|
||||
string category
|
||||
string status
|
||||
text comment
|
||||
string evidence_url
|
||||
timestamp reported_at
|
||||
timestamp reviewed_at
|
||||
text moderator_notes
|
||||
string action_taken
|
||||
}
|
||||
Table contents {
|
||||
id uuid [primary key]
|
||||
title varchar(255)
|
||||
user_id uuid [not null]
|
||||
}
|
||||
|
||||
Table reports {
|
||||
id uuid [primary key]
|
||||
content_id uuid [not null, ref: > contents.id, note: 'Content being reported']
|
||||
reporter_id uuid [not null, ref: > users.id, note: 'User who filed the report']
|
||||
moderator_id uuid [ref: > users.id, note: 'Moderator assigned to review (NULL if pending)']
|
||||
category report_category_enum [not null]
|
||||
status report_status_enum [not null, default: 'pending']
|
||||
comment text [note: 'Reporter explanation (mandatory for "other" category)']
|
||||
evidence_url varchar(512) [note: 'Screenshot or additional proof URL']
|
||||
reported_at timestamp [not null, default: `now()`]
|
||||
reviewed_at timestamp [note: 'When moderator reviewed the report']
|
||||
moderator_notes text [note: 'Internal moderator notes']
|
||||
action_taken report_action_enum [note: 'Action decided by moderator']
|
||||
|
||||
indexes {
|
||||
(content_id, status) [note: 'Find all reports for a content']
|
||||
(status, reported_at) [note: 'Queue for moderators (pending first)']
|
||||
(reporter_id) [note: 'User report history (detect abuse)']
|
||||
(moderator_id) [note: 'Reports assigned to moderator']
|
||||
}
|
||||
}
|
||||
|
||||
Enum report_category_enum {
|
||||
spam [note: 'Contenu publicitaire non sollicité']
|
||||
hate_speech [note: 'Discours haineux, discrimination']
|
||||
violence [note: 'Violence explicite']
|
||||
sexual_content [note: 'Contenu sexuel inapproprié']
|
||||
misinformation [note: 'Désinformation, fake news']
|
||||
copyright [note: 'Violation de droits d auteur']
|
||||
wrong_age_rating [note: 'Classification d âge incorrecte']
|
||||
other [note: 'Autre raison (commentaire obligatoire)']
|
||||
}
|
||||
|
||||
Enum report_status_enum {
|
||||
pending [note: 'En attente de revue']
|
||||
under_review [note: 'En cours d examen par modérateur']
|
||||
actioned [note: 'Action prise (contenu retiré/édité)']
|
||||
dismissed [note: 'Signalement rejeté (contenu valide)']
|
||||
duplicate [note: 'Doublon d un signalement existant']
|
||||
}
|
||||
|
||||
Enum report_action_enum {
|
||||
content_removed [note: 'Contenu supprimé']
|
||||
content_edited [note: 'Métadonnées modifiées (âge, tags)']
|
||||
warning_sent [note: 'Avertissement au créateur']
|
||||
strike_issued [note: 'Strike ajouté au créateur']
|
||||
account_suspended [note: 'Compte créateur suspendu']
|
||||
no_action [note: 'Aucune action (signalement infondé)']
|
||||
}
|
||||
```
|
||||
|
||||
## Légende
|
||||
|
||||
Reference in New Issue
Block a user