From 457c300e8d967e0a84cb0d0df3279a72c5dabb89 Mon Sep 17 00:00:00 2001 From: hormiai76 Date: Wed, 13 Nov 2024 13:38:15 +0000 Subject: [PATCH] Update database sql files --- schema/1_tables.sql | 51 ++++++++++++++++++++++++++++++++++++++++--- schema/2_lookups.sql | 10 ++++++--- schema/3_data.sql | 18 +++++++++++++-- schema/5_routines.sql | 8 +++---- 4 files changed, 75 insertions(+), 12 deletions(-) diff --git a/schema/1_tables.sql b/schema/1_tables.sql index 1c388a2..7d9f97d 100644 --- a/schema/1_tables.sql +++ b/schema/1_tables.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.8.6-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.8.8-MariaDB, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.8.6-MariaDB-1:10.8.6+maria~ubu2204 +-- Server version 10.8.8-MariaDB-1:10.8.8+maria~ubu2204 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1562,7 +1562,7 @@ CREATE TABLE `DataCollectionGroup` ( `blSampleId` int(10) unsigned DEFAULT NULL COMMENT 'references BLSample table', `sessionId` int(10) unsigned NOT NULL COMMENT 'references Session table', `workflowId` int(10) unsigned DEFAULT NULL, - `experimentType` enum('EM','SAD','SAD - Inverse Beam','OSC','Collect - Multiwedge','MAD','Helical','Multi-positional','Mesh','Burn','MAD - Inverse Beam','Characterization','Dehydration','Still','SSX-Chip','SSX-Jet') DEFAULT NULL, + `experimentType` enum('EM','SAD','SAD - Inverse Beam','OSC','Collect - Multiwedge','MAD','Helical','Multi-positional','Mesh','Burn','MAD - Inverse Beam','Characterization','Dehydration','Still','SSX-Chip','SSX-Jet','LineScan','GphNative') DEFAULT NULL, `startTime` datetime DEFAULT NULL COMMENT 'Start time of the dataCollectionGroup', `endTime` datetime DEFAULT NULL COMMENT 'end time of the dataCollectionGroup', `crystalClass` varchar(20) DEFAULT NULL COMMENT 'Crystal Class for industrials users', @@ -3784,6 +3784,51 @@ CREATE TABLE `SSXDataCollection` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Extends DataCollection with SSX-specific fields.'; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `SSXProcessingResult` +-- + +DROP TABLE IF EXISTS `SSXProcessingResult`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `SSXProcessingResult` ( + `ssxProcessingResultId` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', + `dataCollectionId` int(11) unsigned DEFAULT NULL, + `hitRate` float DEFAULT NULL, + `indexingRate` float DEFAULT NULL, + `indexingType` enum('Preliminary','Final') DEFAULT NULL, + `status` enum('Running','Failed','Success') DEFAULT NULL, + `createdTimeStamp` timestamp NOT NULL DEFAULT current_timestamp(), + `lastUpdate` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'last update timestamp', + `comments` varchar(100) DEFAULT NULL, + `nbCrystals` int(11) DEFAULT NULL COMMENT 'Number of crystals', + PRIMARY KEY (`ssxProcessingResultId`), + KEY `dataCollectionId` (`dataCollectionId`), + CONSTRAINT `SSXProcessingResult_ibfk_1` FOREIGN KEY (`dataCollectionId`) REFERENCES `DataCollection` (`dataCollectionId`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Processing Results table for SSX experiments.'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `SSXProcessingResultAttachment` +-- + +DROP TABLE IF EXISTS `SSXProcessingResultAttachment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `SSXProcessingResultAttachment` ( + `ssxProcessingResultAttachmentId` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key', + `ssxProcessingResultId` int(11) unsigned DEFAULT NULL, + `fileName` varchar(255) NOT NULL, + `filePath` varchar(255) NOT NULL, + `fileType` enum('Result','Log','Graph') NOT NULL, + `createdTimeStamp` timestamp NOT NULL DEFAULT current_timestamp(), + `lastUpdate` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'last update timestamp', + PRIMARY KEY (`ssxProcessingResultAttachmentId`), + KEY `ssxProcessingResultId` (`ssxProcessingResultId`), + CONSTRAINT `SSXProcessingResultAttachment_ibfk_1` FOREIGN KEY (`ssxProcessingResultId`) REFERENCES `SSXProcessingResult` (`ssxProcessingResultId`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Processing Results attachments table for SSX experiments.'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `SW_onceToken` -- diff --git a/schema/2_lookups.sql b/schema/2_lookups.sql index a3a3fea..4a9ad65 100644 --- a/schema/2_lookups.sql +++ b/schema/2_lookups.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.8.6-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.8.8-MariaDB, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.8.6-MariaDB-1:10.8.6+maria~ubu2204 +-- Server version 10.8.8-MariaDB-1:10.8.8+maria~ubu2204 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -114,7 +114,11 @@ INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `rec (107,'2021_08_25_New_column_for_Structure.sql','DONE','2021-08-25 10:44:17'), (108,'2022_08_17_AdminVar_bump_version.sql','DONE','2022-08-17 08:47:30'), (109,'2022_08_17_User_Portal_Sync_permission.sql','DONE','2022-08-17 13:13:52'), -(110,'2022_11_21_SSX_experiment.sql','DONE','2023-01-04 12:40:19'); +(110,'2022_11_21_SSX_experiment.sql','DONE','2023-01-04 12:40:19'), +(111,'2024_07_26_SSX_processing_results.sql','DONE','2024-11-13 13:38:12'), +(112,'2024_11_08_DataCollectionGroup_Experimentkind_LineScan.sql','DONE','2024-11-13 13:38:12'), +(113,'2024_11_11_DataCollectionGroup_Experimentkind_GphNative.sql','DONE','2024-11-13 13:38:12'), +(114,'2024_11_13_SSX_processing_results_nbCrystals.sql','DONE','2024-11-13 13:38:12'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; -- diff --git a/schema/3_data.sql b/schema/3_data.sql index 44aa922..b114e48 100644 --- a/schema/3_data.sql +++ b/schema/3_data.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.8.6-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.8.8-MariaDB, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.8.6-MariaDB-1:10.8.6+maria~ubu2204 +-- Server version 10.8.8-MariaDB-1:10.8.8+maria~ubu2204 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1091,6 +1091,20 @@ INSERT INTO `Protein` (`proteinId`, `proposalId`, `name`, `acronym`, `descriptio /*!40000 ALTER TABLE `SSXDataCollection` DISABLE KEYS */; /*!40000 ALTER TABLE `SSXDataCollection` ENABLE KEYS */; +-- +-- Dumping data for table `SSXProcessingResult` +-- + +/*!40000 ALTER TABLE `SSXProcessingResult` DISABLE KEYS */; +/*!40000 ALTER TABLE `SSXProcessingResult` ENABLE KEYS */; + +-- +-- Dumping data for table `SSXProcessingResultAttachment` +-- + +/*!40000 ALTER TABLE `SSXProcessingResultAttachment` DISABLE KEYS */; +/*!40000 ALTER TABLE `SSXProcessingResultAttachment` ENABLE KEYS */; + -- -- Dumping data for table `SW_onceToken` -- diff --git a/schema/5_routines.sql b/schema/5_routines.sql index 34663da..4179e15 100644 --- a/schema/5_routines.sql +++ b/schema/5_routines.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.8.6-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.8.8-MariaDB, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.8.6-MariaDB-1:10.8.6+maria~ubu2204 +-- Server version 10.8.8-MariaDB-1:10.8.8+maria~ubu2204 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,11 +27,11 @@ /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed --- MariaDB dump 10.19 Distrib 10.8.6-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.8.8-MariaDB, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.8.6-MariaDB-1:10.8.6+maria~ubu2204 +-- Server version 10.8.8-MariaDB-1:10.8.8+maria~ubu2204 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;