-- MySQL dump 10.13  Distrib 8.4.7, for Linux (x86_64)
--
-- Host: localhost    Database: shquier_easychair
-- ------------------------------------------------------
-- Server version	8.4.7-0ubuntu0.25.04.2

/*!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 */;
/*!50503 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 `reviews`
--

DROP TABLE IF EXISTS `reviews`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `reviews` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `assignment_id` bigint unsigned DEFAULT NULL,
  `review_assignment_id` bigint unsigned NOT NULL,
  `originality_score` decimal(4,2) DEFAULT NULL,
  `clarity_score` decimal(4,2) DEFAULT NULL,
  `relevance_score` decimal(4,2) DEFAULT NULL,
  `overall_score` decimal(5,2) DEFAULT NULL,
  `recommendation` enum('accept','minor_revision','major_revision','reject') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `comments_to_author` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `comments_to_editor` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `review_file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `org_id` bigint unsigned DEFAULT NULL,
  `conference_id` bigint unsigned DEFAULT NULL,
  `reviewer_id` bigint unsigned DEFAULT NULL,
  `submission_id` bigint unsigned DEFAULT NULL,
  `score` int DEFAULT NULL,
  `decision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `round_no` int DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `fk_reviews_assignment` (`review_assignment_id`),
  KEY `idx_reviews_assignment` (`assignment_id`),
  KEY `idx_org_id` (`org_id`),
  CONSTRAINT `fk_reviews_assignment` FOREIGN KEY (`review_assignment_id`) REFERENCES `review_assignments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `reviews`
--

LOCK TABLES `reviews` WRITE;
/*!40000 ALTER TABLE `reviews` DISABLE KEYS */;
INSERT INTO `reviews` VALUES (1,NULL,7,NULL,NULL,NULL,NULL,'accept',NULL,NULL,NULL,NULL,'2026-04-26 21:09:17','2026-04-28 00:09:36',NULL,1,1,3,6,NULL,NULL,1),(2,10,10,9.00,8.50,8.75,8.75,'accept','Strong paper. Recommended for acceptance.','Good contribution for proceedings.',NULL,'2026-04-27 21:44:53','2026-04-27 18:44:53','2026-04-27 18:44:53',NULL,1,1,12,10,9,'accept',1),(3,9,9,3.00,3.00,3.00,3.00,'minor_revision','تعديلات طفيفة','نسبة استلال عالية','reviews/1/review_9_1777324712.pdf','2026-04-28 00:18:32','2026-04-27 21:18:32','2026-04-27 21:18:32',NULL,1,1,12,9,3,'minor_revision',1);
/*!40000 ALTER TABLE `reviews` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `review_assignments`
--

DROP TABLE IF EXISTS `review_assignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `review_assignments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `submission_id` bigint unsigned NOT NULL,
  `conference_id` bigint unsigned DEFAULT NULL,
  `reviewer_id` bigint unsigned NOT NULL,
  `assigned_by` bigint unsigned DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `status` enum('assigned','accepted','declined','completed','overdue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'assigned',
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `assigned_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `round_no` int NOT NULL DEFAULT '1',
  `org_id` bigint unsigned DEFAULT NULL,
  `accepted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_submission_reviewer` (`submission_id`,`reviewer_id`),
  KEY `fk_review_assignments_reviewer` (`reviewer_id`),
  KEY `fk_review_assignments_assigned_by` (`assigned_by`),
  KEY `idx_org_id` (`org_id`),
  CONSTRAINT `fk_review_assignments_assigned_by` FOREIGN KEY (`assigned_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_review_assignments_reviewer` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `fk_review_assignments_submission` FOREIGN KEY (`submission_id`) REFERENCES `submissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `review_assignments`
--

LOCK TABLES `review_assignments` WRITE;
/*!40000 ALTER TABLE `review_assignments` DISABLE KEYS */;
INSERT INTO `review_assignments` VALUES (1,3,1,1,1,NULL,'assigned',NULL,'2026-04-25 01:48:30',NULL,'2026-04-24 22:48:30','2026-04-27 03:47:36',1,1,NULL),(2,7,2,3,1,NULL,'accepted',NULL,'2026-04-26 18:43:04','2026-04-26 18:45:22','2026-04-26 15:43:04','2026-04-26 15:45:22',1,1,NULL),(7,6,1,3,NULL,NULL,'accepted',NULL,'2026-04-27 00:09:17',NULL,'2026-04-26 21:09:17','2026-04-27 17:48:06',1,1,NULL),(8,8,1,12,10,'2026-05-11','assigned',NULL,'2026-04-27 21:44:53',NULL,'2026-04-27 18:44:53','2026-04-27 18:44:53',1,1,NULL),(9,9,1,12,10,'2026-05-07','completed',NULL,'2026-04-27 21:44:53','2026-04-28 00:18:32','2026-04-27 18:44:53','2026-04-27 21:18:32',1,1,NULL),(10,10,1,12,10,'2026-05-04','completed',NULL,'2026-04-27 21:44:53','2026-04-27 21:44:53','2026-04-27 18:44:53','2026-04-27 18:44:53',1,1,NULL);
/*!40000 ALTER TABLE `review_assignments` ENABLE KEYS */;
UNLOCK TABLES;
/*!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_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trg_ra_org_ins` BEFORE INSERT ON `review_assignments` FOR EACH ROW BEGIN
      IF NEW.org_id IS NULL THEN
        SET NEW.org_id = (SELECT org_id FROM submissions WHERE id=NEW.submission_id LIMIT 1);
      END IF;
    END */;;
DELIMITER ;
/*!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 */ ;
/*!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_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trg_ra_org_upd` BEFORE UPDATE ON `review_assignments` FOR EACH ROW BEGIN
      IF NEW.submission_id <> OLD.submission_id THEN
        SET NEW.org_id = (SELECT org_id FROM submissions WHERE id=NEW.submission_id LIMIT 1);
      END IF;
    END */;;
DELIMITER ;
/*!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 */ ;

--
-- Table structure for table `submissions`
--

DROP TABLE IF EXISTS `submissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `submissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `conference_id` bigint unsigned DEFAULT NULL,
  `track_id` bigint unsigned DEFAULT NULL,
  `submission_type_id` bigint unsigned DEFAULT NULL,
  `author_id` bigint unsigned DEFAULT NULL,
  `submission_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title_ar` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `abstract` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `abstract_ar` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `keywords` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `keywords_ar` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `original_filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `response_letter_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('draft','submitted','screening','under_review','revision_required','revised','accepted','rejected','galley','assigned_to_issue','production','published') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `revision_open_until` datetime DEFAULT NULL,
  `current_round_no` int NOT NULL DEFAULT '1',
  `current_version` int NOT NULL DEFAULT '1',
  `submitted_at` datetime DEFAULT NULL,
  `updated_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `abstract_en` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `keywords_en` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `org_id` bigint unsigned DEFAULT NULL,
  `decision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stage` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issue_id` bigint unsigned DEFAULT NULL,
  `doi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `published_at` datetime DEFAULT NULL,
  `search_index` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `author_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `production_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `revision_file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recommended_decision` enum('accept','minor_revision','major_revision','reject') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avg_score` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `submission_no` (`submission_no`),
  KEY `fk_submissions_conference` (`conference_id`),
  KEY `fk_submissions_track` (`track_id`),
  KEY `fk_submissions_type` (`submission_type_id`),
  KEY `fk_submissions_author` (`author_id`),
  KEY `fk_submissions_updated_by` (`updated_by`),
  KEY `idx_org_id` (`org_id`),
  FULLTEXT KEY `title` (`title`),
  CONSTRAINT `fk_submissions_author` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `fk_submissions_conference` FOREIGN KEY (`conference_id`) REFERENCES `conferences` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_submissions_track` FOREIGN KEY (`track_id`) REFERENCES `tracks` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `fk_submissions_type` FOREIGN KEY (`submission_type_id`) REFERENCES `submission_types` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_submissions_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `submissions`
--

LOCK TABLES `submissions` WRITE;
/*!40000 ALTER TABLE `submissions` DISABLE KEYS */;
INSERT INTO `submissions` VALUES (1,1,1,NULL,4,NULL,NULL,'عنوان1',NULL,'ملخص1',NULL,'كلمة1',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:04:09','2026-04-26 14:13:10','Title1','Abstract1','keyword1, keyword2',1,NULL,'screening',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(2,1,1,NULL,4,'S000002',NULL,'عنوان1',NULL,'ملخص1',NULL,'كلمة1',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:08:21','2026-04-26 14:13:10','Title1','Abstract1','keyword1, keyword2',1,NULL,'screening',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(3,1,1,NULL,4,'S000003',NULL,'بحث بعنوان',NULL,'ملخص',NULL,'كلمة1',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:09:19','2026-04-26 14:13:10','Title1','Abstract','keyword1',1,NULL,'submitted',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(4,1,1,NULL,4,'S000004',NULL,'بحث بعنوان',NULL,'ملخص',NULL,'كلمة1',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:12:37','2026-04-26 14:13:10','Title1','Abstract','keyword1',1,NULL,'screening',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(5,1,2,NULL,4,'S000005',NULL,'بحث بعنوان',NULL,'ملخص',NULL,'كلمة',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:13:20','2026-04-26 14:13:10','Title1','Abstract','keyword',1,NULL,'reviewing',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(6,1,1,NULL,4,'S000006',NULL,'بحث بعنوان',NULL,'ملخص',NULL,'كلمة1',NULL,NULL,NULL,'submitted',NULL,1,1,NULL,NULL,'2026-04-21 16:19:53','2026-04-26 14:13:10','Title1','Abstract','keyword1',1,NULL,'screening',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(7,2,2,NULL,4,'S000007',NULL,'بحث بعنوان',NULL,'ملخص',NULL,'كلمة1',NULL,NULL,NULL,'accepted','2026-05-10 23:25:44',1,1,NULL,NULL,'2026-04-21 16:24:03','2026-04-26 21:05:36','Title1','Abstract','keyword1',1,'accepted','accepted',NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL),(8,1,NULL,NULL,13,'SEED-001','Seed AI Governance Paper','بحث تجريبي حول حوكمة الذكاء الاصطناعي','A seed abstract for AI governance.','ملخص تجريبي حول حوكمة الذكاء الاصطناعي.','AI, Governance','ذكاء اصطناعي، حوكمة',NULL,NULL,NULL,'submitted',NULL,1,1,'2026-04-27 21:44:53',NULL,'2026-04-27 18:44:53','2026-04-27 18:44:53',NULL,NULL,NULL,1,NULL,'screening',NULL,NULL,NULL,NULL,'Seed Author','pending',NULL,NULL,NULL),(9,1,NULL,NULL,13,'SEED-002','Seed Cybersecurity Education Paper','بحث تجريبي حول تعليم الأمن السيبراني','A seed abstract for cybersecurity education.','ملخص تجريبي حول تعليم الأمن السيبراني.','Cybersecurity, Education','أمن سيبراني، تعليم',NULL,NULL,NULL,'under_review',NULL,1,1,'2026-04-27 21:44:53',NULL,'2026-04-27 18:44:53','2026-04-27 21:18:32',NULL,NULL,NULL,1,NULL,'reviewing',NULL,NULL,NULL,NULL,'Seed Author','pending',NULL,'minor_revision',3.00),(10,1,NULL,NULL,13,'SEED-003','Seed Accepted Paper','بحث تجريبي مقبول','A seed abstract for accepted paper.','ملخص تجريبي لبحث مقبول.','OCS, Accepted','نظام مؤتمرات، مقبول',NULL,NULL,NULL,'accepted',NULL,1,1,'2026-04-27 21:44:53',NULL,'2026-04-27 18:44:53','2026-04-27 18:44:53',NULL,NULL,NULL,1,'accepted','accepted',NULL,NULL,NULL,NULL,'Seed Author','pending',NULL,'accept',8.75),(11,3,NULL,NULL,14,'SEED-ORG4-001','Seed Org4 Isolation Paper','بحث تجريبي لعزل المؤسسة الرابعة','A seed abstract for org isolation.','ملخص تجريبي لاختبار عزل المؤسسة.','Isolation, Test','عزل، اختبار',NULL,NULL,NULL,'submitted',NULL,1,1,'2026-04-27 21:44:53',NULL,'2026-04-27 18:44:53','2026-04-27 18:44:53',NULL,NULL,NULL,4,NULL,'screening',NULL,NULL,NULL,NULL,'Seed Org4 Admin','pending',NULL,NULL,NULL),(12,1,NULL,NULL,13,'SUB-1-20260427211527-13','Title Seed','العنوان افتراض','Abstract Demo','ملخص وهمي','keyword1, keyword2','كلمة1، كلمة2','submissions/1/submission_13_1777324527.pdf','استخدام VPL.pdf',NULL,'revision_required',NULL,1,1,'2026-04-28 00:15:27',NULL,'2026-04-27 21:15:27','2026-04-27 22:18:35',NULL,NULL,NULL,1,'revision_required','revision_required',NULL,NULL,NULL,NULL,'Seed Author','pending',NULL,NULL,NULL);
/*!40000 ALTER TABLE `submissions` ENABLE KEYS */;
UNLOCK TABLES;
/*!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_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trg_submissions_org_ins` BEFORE INSERT ON `submissions` FOR EACH ROW BEGIN
      IF NEW.org_id IS NULL THEN
        SET NEW.org_id = (SELECT org_id FROM conferences WHERE id=NEW.conference_id LIMIT 1);
      END IF;
    END */;;
DELIMITER ;
/*!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 */ ;
/*!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_0900_ai_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trg_submissions_org_upd` BEFORE UPDATE ON `submissions` FOR EACH ROW BEGIN
      IF NEW.conference_id <> OLD.conference_id THEN
        SET NEW.org_id = (SELECT org_id FROM conferences WHERE id=NEW.conference_id LIMIT 1);
      END IF;
    END */;;
DELIMITER ;
/*!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 */ ;
/*!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-04-28  3:10:17
