383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
-- Associations entre fichiers et journal de compta (pièce comptable par exemple)
(
fichier INTEGER NOT NULL REFERENCES fichiers (id),
id INTEGER NOT NULL REFERENCES compta_journal (id),
PRIMARY KEY(fichier, id)
);
CREATE TABLE IF NOT EXISTS emails_attente (
-- Emails en attente d'expédition (queue d'envoi)
id INTEGER NOT NULL PRIMARY KEY,
adresse TEXT NOT NULL,
id_membre INTEGER NULL REFERENCES membres (id) ON DELETE CASCADE,
sujet TEXT NOT NULL,
contenu TEXT NOT NULL,
date_envoi TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date_envoi) IS NOT NULL AND datetime(date_envoi) = date_envoi),
statut INTEGER NOT NULL DEFAULT 0 -- 0 = en attente, 1 = en cours d'envoi
);
CREATE TABLE IF NOT EXISTS emails_rejets (
-- Adresses email qui ne peuvent recevoir de message
adresse TEXT NOT NULL PRIMARY KEY,
date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date) IS NOT NULL AND datetime(date) = date),
message TEXT NOT NULL,
statut INTEGER NOT NULL DEFAULT 0 -- -1 = désinscription à l'initiative de l'utilisateur, -2 = boîte mail inexistante, >= 1 = nombre de rejets temporaire
);
|
|
|
>
<
|
|
<
|
<
<
|
<
<
|
<
|
<
|
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
-- Associations entre fichiers et journal de compta (pièce comptable par exemple)
(
fichier INTEGER NOT NULL REFERENCES fichiers (id),
id INTEGER NOT NULL REFERENCES compta_journal (id),
PRIMARY KEY(fichier, id)
);
CREATE TABLE IF NOT EXISTS recherches
-- Recherches enregistrées
(
id INTEGER NOT NULL PRIMARY KEY,
id_membre INTEGER NULL REFERENCES membres (id) ON DELETE CASCADE, -- Si non NULL, alors la recherche ne sera visible que par le membre associé
intitule TEXT NOT NULL,
creation TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(creation) IS NOT NULL AND datetime(creation) = creation),
table TEXT NOT NULL, -- "membres" ou "compta_journal"
type TEXT NOT NULL, -- "json" ou "sql"
contenu TEXT NOT NULL
);
|