--
-- Host: localhost    Database: signalingserver
-- ------------------------------------------------------


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

CREATE TABLE `rooms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `offer` longtext DEFAULT NULL COMMENT 'WebRTC  json formata savienojuma izveides kods',
  `answer` longtext DEFAULT NULL COMMENT 'WebRTC  json formata savienojuma atbildes kods',
  `name` varchar(100) DEFAULT NULL COMMENT 'istabas nosaukums',
  `created_at` datetime DEFAULT current_timestamp() COMMENT 'tagadejais laiks',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping events for database 'signalingserver'
--
/*!50106 DROP EVENT IF EXISTS `delete_every_5_min` */;
DELIMITER ;;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;;
/*!50003 SET character_set_client  = utf8mb4 */ ;;
/*!50003 SET character_set_results = utf8mb4 */ ;;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;;
/*!50003 SET sql_mode              = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone      = @@time_zone */ ;;
/*!50003 SET time_zone             = 'SYSTEM' */ ;;
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `delete_every_5_min` ON SCHEDULE EVERY 10 MINUTE STARTS '2025-12-04 16:49:30' ON COMPLETION NOT PRESERVE ENABLE DO delete FROM signalingserver.rooms
WHERE created_at < (NOW() - INTERVAL 10 MINUTE) */ ;;
/*!50003 SET time_zone             = @saved_time_zone */ ;;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;;
/*!50003 SET character_set_client  = @saved_cs_client */ ;;
/*!50003 SET character_set_results = @saved_cs_results */ ;;
/*!50003 SET collation_connection  = @saved_col_connection */ ;;
DELIMITER ;


