-- https://www.phpmyadmin.net/
--
-- Hôte : lieberrauth.mysql.db
-- Généré le : sam. 27 juin 2026 à 19:36
-- Version du serveur : 8.4.8-8
-- Version de PHP : 8.4.10

START TRANSACTION;



--
-- Base de données : `lieberrauth`
--

-- --------------------------------------------------------

--
-- Structure de la table `certificate_access_events`
--

CREATE TABLE `certificate_access_events` (
  `id` bigint UNSIGNED NOT NULL,
  `certificate_id` int NOT NULL,
  `event_type` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `ip_hash` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent_hash` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `certificate_access_events`
--

INSERT INTO `certificate_access_events` (`id`, `certificate_id`, `event_type`, `event_data`, `ip_hash`, `user_agent_hash`, `created_at`) VALUES
(1, 3, 'public_identification', '{\"lang\":\"fr\",\"path\":\"/auth/identifier.php\"}', 'af67e6184e8ea3f751b06d4188ee9d337053fbfa0ec046d7e8bef52c1e94e1a5', '4ceca42c3ac1aca482958f961d41398a2de597c2516d2329b859dfda233fa63b', '2026-06-27 13:30:02'),
(2, 3, 'public_identification', '{\"lang\":\"fr\",\"path\":\"/auth/identifier.php\"}', 'af67e6184e8ea3f751b06d4188ee9d337053fbfa0ec046d7e8bef52c1e94e1a5', '4ceca42c3ac1aca482958f961d41398a2de597c2516d2329b859dfda233fa63b', '2026-06-27 19:09:11');

--
-- Index pour les tables déchargées
--

--
-- Index pour la table `certificate_access_events`
--
ALTER TABLE `certificate_access_events`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_certificate_access_events_certificate_date` (`certificate_id`,`created_at`),
  ADD KEY `idx_certificate_access_events_type` (`event_type`),
  ADD KEY `idx_certificate_access_events_fingerprint` (`ip_hash`,`user_agent_hash`),
  ADD KEY `idx_certificate_access_events_type_created` (`event_type`,`created_at`),
  ADD KEY `idx_certificate_access_events_fingerprint_created` (`ip_hash`,`user_agent_hash`,`created_at`);

--
-- AUTO_INCREMENT pour les tables déchargées
--

--
-- AUTO_INCREMENT pour la table `certificate_access_events`
--
ALTER TABLE `certificate_access_events`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `certificate_access_events`
--
ALTER TABLE `certificate_access_events`
  ADD CONSTRAINT `fk_certificate_access_events_certificate` FOREIGN KEY (`certificate_id`) REFERENCES `certificats` (`id`) ON DELETE CASCADE;
COMMIT;

