-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: 127.0.0.1    Database: smdummy572026
-- ------------------------------------------------------
-- Server version	10.4.32-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `hik_sync_events`
--

DROP TABLE IF EXISTS `hik_sync_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `hik_sync_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `event_key` char(64) NOT NULL,
  `device_key` varchar(100) NOT NULL,
  `source_ip` varchar(45) NOT NULL,
  `serial_no` bigint(20) NOT NULL,
  `hik_employee_no` varchar(255) NOT NULL,
  `raw_name` varchar(255) NOT NULL DEFAULT '',
  `event_time` datetime NOT NULL,
  `attendance_status` varchar(50) NOT NULL DEFAULT '',
  `event_label` varchar(100) NOT NULL DEFAULT '',
  `verify_mode` varchar(100) NOT NULL DEFAULT '',
  `major_code` int(11) DEFAULT NULL,
  `minor_code` int(11) DEFAULT NULL,
  `picture_url` text DEFAULT NULL,
  `raw_json` longtext NOT NULL,
  `received_at` datetime NOT NULL DEFAULT current_timestamp(),
  `mirrored_at` datetime DEFAULT NULL,
  `mirror_error` varchar(1000) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_hik_sync_event_key` (`event_key`),
  UNIQUE KEY `uq_hik_sync_device_serial` (`device_key`,`serial_no`),
  KEY `idx_hik_sync_employee_time` (`hik_employee_no`,`event_time`),
  KEY `idx_hik_sync_pending` (`mirrored_at`,`event_time`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `hik_sync_events`
--

LOCK TABLES `hik_sync_events` WRITE;
/*!40000 ALTER TABLE `hik_sync_events` DISABLE KEYS */;
INSERT INTO `hik_sync_events` VALUES (1,'8c41e1a3b990fde06bf175215e5b56e6ac342bd475476e9f53b9f3647c620d1c','smdummy-main','192.168.1.151',53739,'1','ricardo rimando','2026-07-23 13:56:36','checkIn','Morning In','faceOrFpOrCardOrPw',5,38,'','{\"major\":5,\"minor\":38,\"time\":\"2026-07-23T13:56:36+08:00\",\"cardType\":1,\"name\":\"ricardo rimando\",\"cardReaderNo\":1,\"doorNo\":1,\"employeeNoString\":\"1\",\"serialNo\":53739,\"userType\":\"normal\",\"currentVerifyMode\":\"faceOrFpOrCardOrPw\",\"attendanceStatus\":\"checkIn\",\"label\":\"Morning In\",\"mask\":\"unknown\"}','2026-07-23 14:07:51',NULL,NULL),(2,'c5a66aca1472993f9f5191f37450c9a989294e1f914bf7b6dd8772405e2f246f','smdummy-main','192.168.1.151',53745,'1','ricardo rimando','2026-07-23 14:06:40','checkIn','Morning In','faceOrFpOrCardOrPw',5,38,'','{\"major\":5,\"minor\":38,\"time\":\"2026-07-23T14:06:40+08:00\",\"cardType\":1,\"name\":\"ricardo rimando\",\"cardReaderNo\":1,\"doorNo\":1,\"employeeNoString\":\"1\",\"serialNo\":53745,\"userType\":\"normal\",\"currentVerifyMode\":\"faceOrFpOrCardOrPw\",\"attendanceStatus\":\"checkIn\",\"label\":\"Morning In\",\"mask\":\"unknown\"}','2026-07-23 14:13:55',NULL,NULL);
/*!40000 ALTER TABLE `hik_sync_events` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-07-23 14:38:47
