--
-- Host: localhost    Database: mmwave_v3
-- ------------------------------------------------------


--
-- Table structure for table `rooms`
--

CREATE TABLE `rooms` (
  `room_id` int(11) NOT NULL AUTO_INCREMENT,
  `room_name` varchar(100) NOT NULL,
  `last_activity` enum('walk','stand','sit','fall','lay','transition','null') DEFAULT 'null',
  `last_x` float DEFAULT 0,
  `last_y` float DEFAULT 0,
  `last_confidence` float DEFAULT 0,
  `current_act_start` datetime DEFAULT current_timestamp(),
  `last_seen_activity` datetime DEFAULT NULL,
  `last_seen_position` datetime DEFAULT NULL,
  PRIMARY KEY (`room_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rooms`
--

INSERT INTO `rooms` VALUES
(1,'home','sit',1.2,2,0.59,'2026-05-26 01:42:13','2026-05-26 01:42:13','2026-05-26 01:35:21');

--
-- Table structure for table `radar_devices`
--

CREATE TABLE `radar_devices` (
  `device_id` int(11) NOT NULL AUTO_INCREMENT,
  `room_id` int(11) NOT NULL,
  `device_name` varchar(100) NOT NULL,
  `device_role` enum('position','activity','all') NOT NULL,
  `status` enum('active','inactive') DEFAULT 'active',
  PRIMARY KEY (`device_id`),
  KEY `room_id` (`room_id`),
  CONSTRAINT `radar_devices_ibfk_1` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`room_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `radar_devices`
--

INSERT INTO `radar_devices` VALUES
(1,1,'rader1','activity','active'),
(2,1,'rader2','position','active');

--
-- Table structure for table `system_settings`
--

CREATE TABLE `system_settings` (
  `setting_key` varchar(50) NOT NULL,
  `setting_value` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`setting_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system_settings`
--

INSERT INTO `system_settings` VALUES
('test_connection','success_from_external_ip'),
('threshold_no_home_min','10'),
('threshold_no_move_min','3');


