67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
id INTEGER NOT NULL PRIMARY KEY,
id_user INTEGER NOT NULL REFERENCES membres (id) ON DELETE CASCADE,
id_service INTEGER NOT NULL REFERENCES services (id) ON DELETE CASCADE,
id_fee INTEGER NULL REFERENCES services_fees (id) ON DELETE CASCADE,
paid INTEGER NOT NULL DEFAULT 0,
expiry_date TEXT NULL DEFAULT CURRENT_DATE CHECK (date(expiry_date) IS NOT NULL AND date(expiry_date) = expiry_date)
);
CREATE UNIQUE INDEX IF NOT EXISTS su_unique ON services_users (id_user, id_service, expiry_date);
CREATE TABLE IF NOT EXISTS services_reminders
-- Rappels de devoir renouveller une cotisation
(
|
|
>
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
id INTEGER NOT NULL PRIMARY KEY,
id_user INTEGER NOT NULL REFERENCES membres (id) ON DELETE CASCADE,
id_service INTEGER NOT NULL REFERENCES services (id) ON DELETE CASCADE,
id_fee INTEGER NULL REFERENCES services_fees (id) ON DELETE CASCADE,
paid INTEGER NOT NULL DEFAULT 0,
date TEXT NULL DEFAULT CURRENT_DATE CHECK (date(date) IS NOT NULL AND date(date) = date)
expiry_date TEXT NULL CHECK (date(expiry_date) IS NULL OR date(expiry_date) = expiry_date)
);
CREATE UNIQUE INDEX IF NOT EXISTS su_unique ON services_users (id_user, id_service, expiry_date);
CREATE TABLE IF NOT EXISTS services_reminders
-- Rappels de devoir renouveller une cotisation
(
|