From 0cceb755cb56b9236363409bf07b951fe0f2bb5a Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Tue, 23 Apr 2019 12:08:54 +0100 Subject: [PATCH 1/4] Drop view v_run, add more runs to table v_run, bump up version --- schema/data.sql | 16 +++++-- schema/tables.sql | 47 ++++++------------- .../2019_04_23_AdminVar_bump_version.sql | 5 ++ schema/updates/2019_04_23_drop_v_run_view.sql | 5 ++ .../2019_04_23_v_run_additional_runs.sql | 15 ++++++ 5 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 schema/updates/2019_04_23_AdminVar_bump_version.sql create mode 100644 schema/updates/2019_04_23_drop_v_run_view.sql create mode 100644 schema/updates/2019_04_23_v_run_additional_runs.sql diff --git a/schema/data.sql b/schema/data.sql index c95cbd3e..e16da18e 100644 --- a/schema/data.sql +++ b/schema/data.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.17 Distrib 10.3.13-MariaDB, for Linux (x86_64) +-- MySQL dump 10.17 Distrib 10.3.14-MariaDB, for Linux (x86_64) -- -- Host: localhost Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.3.13-MariaDB +-- Server version 10.3.14-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1755,6 +1755,16 @@ LOCK TABLES `XrayCentringResult` WRITE; /*!40000 ALTER TABLE `XrayCentringResult` DISABLE KEYS */; /*!40000 ALTER TABLE `XrayCentringResult` ENABLE KEYS */; UNLOCK TABLES; + +-- +-- Dumping data for table `v_run` +-- + +LOCK TABLES `v_run` WRITE; +/*!40000 ALTER TABLE `v_run` DISABLE KEYS */; +INSERT INTO `v_run` (`runId`, `run`, `startDate`, `endDate`) VALUES (1,'2008-01','2007-12-17 09:00:00','2008-02-09 08:59:59'),(2,'2008-02','2008-02-09 09:00:00','2008-03-14 08:59:59'),(3,'2008-03','2008-03-14 09:00:00','2008-04-28 08:59:59'),(4,'2008-04','2008-04-28 09:00:00','2008-05-30 08:59:59'),(5,'2008-05','2008-05-30 09:00:00','2008-07-12 08:59:59'),(6,'2008-06','2008-07-12 09:00:00','2008-08-15 08:59:59'),(7,'2008-07','2008-08-15 09:00:00','2008-09-27 08:59:59'),(8,'2008-08','2008-09-27 09:00:00','2008-10-31 08:59:59'),(9,'2008-09','2008-10-31 09:00:00','2008-12-19 08:59:59'),(10,'2009-01','2008-12-19 09:00:00','2009-02-09 08:59:59'),(11,'2009-02','2009-02-09 09:00:00','2009-03-13 08:59:59'),(12,'2009-03','2009-03-13 09:00:00','2009-04-25 08:59:59'),(13,'2009-04','2009-04-25 09:00:00','2009-05-29 08:59:59'),(14,'2009-05','2009-05-29 09:00:00','2009-07-18 08:59:59'),(15,'2009-06','2009-07-18 09:00:00','2009-08-14 08:59:59'),(16,'2009-07','2009-08-14 09:00:00','2009-09-29 08:59:59'),(17,'2009-08','2009-09-29 09:00:00','2009-10-30 08:59:59'),(18,'2009-09','2009-10-30 09:00:00','2009-12-18 08:59:59'),(19,'2010-01','2009-12-18 09:00:00','2010-02-08 08:59:59'),(20,'2010-02','2010-02-08 09:00:00','2010-03-15 08:59:59'),(21,'2010-03','2010-03-15 09:00:00','2010-06-01 08:59:59'),(22,'2010-04','2010-06-01 09:00:00','2010-08-13 08:59:59'),(23,'2010-05','2010-08-13 09:00:00','2010-11-01 08:59:59'),(24,'2010-06','2010-11-01 09:00:00','2010-12-23 08:59:59'),(25,'2011-01','2010-12-23 09:00:00','2011-03-04 08:59:59'),(26,'2011-02','2011-03-04 09:00:00','2011-06-03 08:59:59'),(27,'2011-03','2011-06-03 09:00:00','2011-08-12 08:59:59'),(28,'2011-04','2011-08-12 09:00:00','2011-11-07 08:59:59'),(29,'2011-05','2011-11-07 09:00:00','2011-12-22 08:59:59'),(30,'2012-01','2011-12-22 09:00:00','2012-03-26 08:59:59'),(31,'2012-02','2012-03-26 09:00:00','2012-06-01 08:59:59'),(32,'2012-03','2012-06-01 09:00:00','2012-08-17 08:59:59'),(33,'2012-04','2012-08-17 09:00:00','2012-11-02 08:59:59'),(34,'2012-05','2012-11-02 09:00:00','2012-12-21 08:59:59'),(35,'2013-01','2012-12-21 09:00:00','2013-03-22 08:59:59'),(36,'2013-02','2013-03-22 09:00:00','2013-05-31 08:59:59'),(37,'2013-03','2013-05-31 09:00:00','2013-08-16 08:59:59'),(38,'2013-04','2013-08-16 09:00:00','2013-11-01 08:59:59'),(39,'2013-05','2013-11-01 09:00:00','2013-12-20 08:59:59'),(40,'2014-01','2013-12-20 09:00:00','2014-03-14 08:59:59'),(41,'2014-02','2014-03-14 09:00:00','2014-05-30 08:59:59'),(42,'2014-03','2014-05-30 09:00:00','2014-08-15 08:59:59'),(43,'2014-04','2014-08-15 09:00:00','2014-10-24 08:59:59'),(44,'2014-05','2014-10-24 09:00:00','2014-12-19 08:59:59'),(45,'2015-01','2014-12-19 09:00:00','2015-03-13 08:59:59'),(46,'2015-02','2015-03-13 09:00:00','2015-05-29 08:59:59'),(47,'2015-03','2015-05-29 09:00:00','2015-08-14 08:59:59'),(48,'2015-04','2015-08-14 09:00:00','2015-10-23 08:59:59'),(49,'2015-05','2015-10-23 09:00:00','2015-12-18 08:59:59'),(50,'2016-01','2015-12-18 09:00:00','2016-03-11 08:59:59'),(51,'2016-02','2016-03-11 09:00:00','2016-05-20 08:59:59'),(52,'2016-03','2016-05-20 09:00:00','2016-08-12 08:59:59'),(53,'2016-04','2016-08-12 09:00:00','2016-10-07 08:59:59'),(54,'2016-05','2016-10-07 09:00:00','2016-12-20 08:59:59'),(55,'2017-01','2016-12-20 09:00:00','2017-03-17 08:59:59'),(56,'2017-02','2017-03-17 09:00:00','2017-05-26 08:59:59'),(57,'2017-03','2017-05-26 09:00:00','2017-08-11 08:59:59'),(58,'2017-04','2017-08-11 09:00:00','2017-10-27 08:59:59'),(59,'2017-05','2017-10-27 09:00:00','2017-12-19 08:59:59'),(60,'2018-01','2017-12-19 09:00:00','2018-03-16 08:59:59'),(61,'2018-02','2018-03-16 09:00:00','2018-05-24 08:59:59'),(62,'2018-03','2018-05-24 09:00:00','2018-08-10 08:59:59'),(63,'2018-04','2018-08-10 09:00:00','2018-10-26 08:59:59'),(64,'2018-05','2018-10-26 09:00:00','2018-12-18 08:59:59'),(65,'2019-01','2018-12-18 09:00:00','2019-03-08 08:59:59'),(66,'2019-02','2019-03-08 09:00:00','2019-05-23 08:59:59'),(67,'2019-03','2019-05-23 09:00:00','2019-08-09 08:59:59'); +/*!40000 ALTER TABLE `v_run` ENABLE KEYS */; +UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1764,4 +1774,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-04-03 16:47:22 +-- Dump completed on 2019-04-23 11:38:32 diff --git a/schema/tables.sql b/schema/tables.sql index 0357184e..fbf9ea21 100644 --- a/schema/tables.sql +++ b/schema/tables.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.17 Distrib 10.3.13-MariaDB, for Linux (x86_64) +-- MySQL dump 10.17 Distrib 10.3.14-MariaDB, for Linux (x86_64) -- -- Host: localhost Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.3.13-MariaDB +-- Server version 10.3.14-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -5149,20 +5149,20 @@ SET character_set_client = utf8; SET character_set_client = @saved_cs_client; -- --- Temporary table structure for view `v_run` +-- Table structure for table `v_run` -- DROP TABLE IF EXISTS `v_run`; -/*!50001 DROP VIEW IF EXISTS `v_run`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `v_run` ( - `runId` tinyint NOT NULL, - `run` tinyint NOT NULL, - `startDate` tinyint NOT NULL, - `endDate` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `v_run` ( + `runId` int(11) unsigned NOT NULL AUTO_INCREMENT, + `run` varchar(7) NOT NULL DEFAULT '', + `startDate` datetime DEFAULT NULL, + `endDate` datetime DEFAULT NULL, + PRIMARY KEY (`runId`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Temporary table structure for view `v_sample` @@ -5588,25 +5588,6 @@ SET character_set_client = @saved_cs_client; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; --- --- Final view structure for view `v_run` --- - -/*!50001 DROP TABLE IF EXISTS `v_run`*/; -/*!50001 DROP VIEW IF EXISTS `v_run`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8 */; -/*!50001 SET character_set_results = utf8 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 SQL SECURITY INVOKER */ -/*!50001 VIEW `v_run` AS select 1 AS `runId`,'2008-01' AS `run`,str_to_date('2007-12-17 09:00:00','%Y-%m-%d %H:%i:%s') AS `startDate`,str_to_date('2008-02-09 08:59:59','%Y-%m-%d %H:%i:%s') AS `endDate` union select 2 AS `2`,'2008-02' AS `2008-02`,str_to_date('2008-02-09 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-02-09 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-03-14 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-03-14 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 3 AS `3`,'2008-03' AS `2008-03`,str_to_date('2008-03-14 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-03-14 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-04-28 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-04-28 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 4 AS `4`,'2008-04' AS `2008-04`,str_to_date('2008-04-28 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-04-28 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-05-30 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-05-30 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 5 AS `5`,'2008-05' AS `2008-05`,str_to_date('2008-05-30 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-05-30 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-07-12 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-07-12 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 6 AS `6`,'2008-06' AS `2008-06`,str_to_date('2008-07-12 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-07-12 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-08-15 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-08-15 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 7 AS `7`,'2008-07' AS `2008-07`,str_to_date('2008-08-15 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-08-15 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-09-27 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-09-27 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 8 AS `8`,'2008-08' AS `2008-08`,str_to_date('2008-09-27 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-09-27 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-10-31 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-10-31 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 9 AS `9`,'2008-09' AS `2008-09`,str_to_date('2008-10-31 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-10-31 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2008-12-19 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-12-19 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 10 AS `10`,'2009-01' AS `2009-01`,str_to_date('2008-12-19 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2008-12-19 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-02-09 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-02-09 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 11 AS `11`,'2009-02' AS `2009-02`,str_to_date('2009-02-09 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-02-09 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-03-13 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-03-13 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 12 AS `12`,'2009-03' AS `2009-03`,str_to_date('2009-03-13 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-03-13 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-04-25 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-04-25 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 13 AS `13`,'2009-04' AS `2009-04`,str_to_date('2009-04-25 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-04-25 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-05-29 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-05-29 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 14 AS `14`,'2009-05' AS `2009-05`,str_to_date('2009-05-29 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-05-29 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-07-18 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-07-18 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 15 AS `15`,'2009-06' AS `2009-06`,str_to_date('2009-07-18 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-07-18 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-08-14 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-08-14 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 16 AS `16`,'2009-07' AS `2009-07`,str_to_date('2009-08-14 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-08-14 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-09-29 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-09-29 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 17 AS `17`,'2009-08' AS `2009-08`,str_to_date('2009-09-29 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-09-29 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-10-30 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-10-30 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 18 AS `18`,'2009-09' AS `2009-09`,str_to_date('2009-10-30 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-10-30 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2009-12-18 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-12-18 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 19 AS `19`,'2010-01' AS `2010-01`,str_to_date('2009-12-18 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2009-12-18 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-02-08 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-02-08 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 20 AS `20`,'2010-02' AS `2010-02`,str_to_date('2010-02-08 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-02-08 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-03-15 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-03-15 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 21 AS `21`,'2010-03' AS `2010-03`,str_to_date('2010-03-15 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-03-15 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-06-01 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-06-01 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 22 AS `22`,'2010-04' AS `2010-04`,str_to_date('2010-06-01 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-06-01 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-08-13 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-08-13 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 23 AS `23`,'2010-05' AS `2010-05`,str_to_date('2010-08-13 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-08-13 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-11-01 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-11-01 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 24 AS `24`,'2010-06' AS `2010-06`,str_to_date('2010-11-01 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-11-01 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2010-12-23 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-12-23 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 25 AS `25`,'2011-01' AS `2011-01`,str_to_date('2010-12-23 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2010-12-23 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2011-03-04 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-03-04 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 26 AS `26`,'2011-02' AS `2011-02`,str_to_date('2011-03-04 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-03-04 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2011-06-03 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-06-03 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 27 AS `27`,'2011-03' AS `2011-03`,str_to_date('2011-06-03 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-06-03 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2011-08-12 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-08-12 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 28 AS `28`,'2011-04' AS `2011-04`,str_to_date('2011-08-12 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-08-12 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2011-11-07 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-11-07 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 29 AS `29`,'2011-05' AS `2011-05`,str_to_date('2011-11-07 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-11-07 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2011-12-22 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-12-22 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 30 AS `30`,'2012-01' AS `2012-01`,str_to_date('2011-12-22 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2011-12-22 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2012-03-26 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-03-26 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 31 AS `31`,'2012-02' AS `2012-02`,str_to_date('2012-03-26 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-03-26 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2012-06-01 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-06-01 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 32 AS `32`,'2012-03' AS `2012-03`,str_to_date('2012-06-01 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-06-01 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2012-08-17 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-08-17 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 33 AS `33`,'2012-04' AS `2012-04`,str_to_date('2012-08-17 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-08-17 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2012-11-02 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-11-02 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 34 AS `34`,'2012-05' AS `2012-05`,str_to_date('2012-11-02 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-11-02 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2012-12-21 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-12-21 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 35 AS `35`,'2013-01' AS `2013-01`,str_to_date('2012-12-21 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2012-12-21 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2013-03-22 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-03-22 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 36 AS `36`,'2013-02' AS `2013-02`,str_to_date('2013-03-22 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-03-22 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2013-05-31 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-05-31 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 37 AS `37`,'2013-03' AS `2013-03`,str_to_date('2013-05-31 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-05-31 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2013-08-16 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-08-16 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 38 AS `38`,'2013-04' AS `2013-04`,str_to_date('2013-08-16 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-08-16 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2013-11-01 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-11-01 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 39 AS `39`,'2013-05' AS `2013-05`,str_to_date('2013-11-01 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-11-01 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2013-12-20 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-12-20 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 40 AS `40`,'2014-01' AS `2014-01`,str_to_date('2013-12-20 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2013-12-20 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2014-03-14 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-03-14 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 41 AS `41`,'2014-02' AS `2014-02`,str_to_date('2014-03-14 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-03-14 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2014-05-30 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-05-30 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 42 AS `42`,'2014-03' AS `2014-03`,str_to_date('2014-05-30 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-05-30 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2014-08-15 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-08-15 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 43 AS `43`,'2014-04' AS `2014-04`,str_to_date('2014-08-15 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-08-15 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2014-10-24 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-10-24 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 44 AS `44`,'2014-05' AS `2014-05`,str_to_date('2014-10-24 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-10-24 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2014-12-19 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-12-19 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 45 AS `45`,'2015-01' AS `2015-01`,str_to_date('2014-12-19 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2014-12-19 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2015-03-13 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-03-13 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 46 AS `46`,'2015-02' AS `2015-02`,str_to_date('2015-03-13 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-03-13 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2015-05-29 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-05-29 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 47 AS `47`,'2015-03' AS `2015-03`,str_to_date('2015-05-29 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-05-29 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2015-08-14 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-08-14 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 48 AS `48`,'2015-04' AS `2015-04`,str_to_date('2015-08-14 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-08-14 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2015-10-23 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-10-23 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 49 AS `49`,'2015-05' AS `2015-05`,str_to_date('2015-10-23 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-10-23 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2015-12-18 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-12-18 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 50 AS `50`,'2016-01' AS `2016-01`,str_to_date('2015-12-18 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2015-12-18 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2016-03-11 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-03-11 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 51 AS `51`,'2016-02' AS `2016-02`,str_to_date('2016-03-11 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-03-11 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2016-05-20 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-05-20 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 52 AS `52`,'2016-03' AS `2016-03`,str_to_date('2016-05-20 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-05-20 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2016-08-12 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-08-12 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 53 AS `53`,'2016-04' AS `2016-04`,str_to_date('2016-08-12 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-08-12 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2016-10-07 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-10-07 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 54 AS `54`,'2016-05' AS `2016-05`,str_to_date('2016-10-07 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-10-07 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2016-12-20 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-12-20 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 55 AS `55`,'2017-01' AS `2017-01`,str_to_date('2016-12-20 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2016-12-20 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2017-03-17 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-03-17 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 56 AS `56`,'2017-02' AS `2017-02`,str_to_date('2017-03-17 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-03-17 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2017-05-26 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-05-26 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 57 AS `57`,'2017-03' AS `2017-03`,str_to_date('2017-05-26 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-05-26 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2017-08-11 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-08-11 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 58 AS `58`,'2017-04' AS `2017-04`,str_to_date('2017-08-11 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-08-11 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2017-10-27 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-10-27 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 59 AS `59`,'2017-05' AS `2017-05`,str_to_date('2017-10-27 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-10-27 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2017-12-19 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-12-19 08:59:59', '%Y-%m-%d %H:%i:%s')` union select 60 AS `60`,'2018-01' AS `2018-01`,str_to_date('2017-12-19 09:00:00','%Y-%m-%d %H:%i:%s') AS `str_to_date('2017-12-19 09:00:00', '%Y-%m-%d %H:%i:%s')`,str_to_date('2018-02-28 08:59:59','%Y-%m-%d %H:%i:%s') AS `str_to_date('2018-02-28 08:59:59', '%Y-%m-%d %H:%i:%s')` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; - -- -- Final view structure for view `v_sample` -- @@ -5692,4 +5673,4 @@ SET character_set_client = @saved_cs_client; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-04-03 15:51:29 +-- Dump completed on 2019-04-23 11:38:31 diff --git a/schema/updates/2019_04_23_AdminVar_bump_version.sql b/schema/updates/2019_04_23_AdminVar_bump_version.sql new file mode 100644 index 00000000..a619d4b3 --- /dev/null +++ b/schema/updates/2019_04_23_AdminVar_bump_version.sql @@ -0,0 +1,5 @@ +INSERT INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2019_04_23_AdminVar_bump_version.sql', 'ONGOING'); + +UPDATE AdminVar SET `value` = '1.4.0' WHERE `name` = 'schemaVersion'; + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2019_04_23_AdminVar_bump_version.sql'; diff --git a/schema/updates/2019_04_23_drop_v_run_view.sql b/schema/updates/2019_04_23_drop_v_run_view.sql new file mode 100644 index 00000000..bd925b39 --- /dev/null +++ b/schema/updates/2019_04_23_drop_v_run_view.sql @@ -0,0 +1,5 @@ +INSERT INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2019_04_23_drop_v_run_view.sql', 'ONGOING'); + +DROP VIEW IF EXISTS v_run; + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2019_04_23_drop_v_run_view.sql'; diff --git a/schema/updates/2019_04_23_v_run_additional_runs.sql b/schema/updates/2019_04_23_v_run_additional_runs.sql new file mode 100644 index 00000000..f30d6582 --- /dev/null +++ b/schema/updates/2019_04_23_v_run_additional_runs.sql @@ -0,0 +1,15 @@ +-- This script contains Diamond test data only. +-- Do not run this on a production database as +-- other synchrotrons/facilities will have their own +-- run schedule. + + +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; + +LOCK TABLES `v_run` WRITE; +/*!40000 ALTER TABLE `v_run` DISABLE KEYS */; +INSERT INTO `v_run` VALUES (62,'2018-03','2018-05-24 09:00:00','2018-08-10 08:59:59'),(63,'2018-04','2018-08-10 09:00:00','2018-10-26 08:59:59'),(64,'2018-05','2018-10-26 09:00:00','2018-12-18 08:59:59'),(65,'2019-01','2018-12-18 09:00:00','2019-03-08 08:59:59'),(66,'2019-02','2019-03-08 09:00:00','2019-05-23 08:59:59'),(67,'2019-03','2019-05-23 09:00:00','2019-08-09 08:59:59'); +/*!40000 ALTER TABLE `v_run` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; From d807911d2711b4c30a3a9279d6b7b52588ef1241 Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Tue, 23 Apr 2019 12:15:18 +0100 Subject: [PATCH 2/4] Include new version and scripts in SchemaStatus --- schema/lookups.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schema/lookups.sql b/schema/lookups.sql index 987ab75c..e4a4e965 100644 --- a/schema/lookups.sql +++ b/schema/lookups.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.17 Distrib 10.3.13-MariaDB, for Linux (x86_64) +-- MySQL dump 10.17 Distrib 10.3.14-MariaDB, for Linux (x86_64) -- -- Host: localhost Database: ispyb_build -- ------------------------------------------------------ --- Server version 10.3.13-MariaDB +-- Server version 10.3.14-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -20,7 +20,7 @@ LOCK TABLES `AdminVar` WRITE; /*!40000 ALTER TABLE `AdminVar` DISABLE KEYS */; -INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','1.3.0'); +INSERT INTO `AdminVar` (`varId`, `name`, `value`) VALUES (4,'schemaVersion','1.4.0'); /*!40000 ALTER TABLE `AdminVar` ENABLE KEYS */; UNLOCK TABLES; @@ -30,7 +30,7 @@ UNLOCK TABLES; LOCK TABLES `SchemaStatus` WRITE; /*!40000 ALTER TABLE `SchemaStatus` DISABLE KEYS */; -INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'); +INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'),(63,'2019_04_23_AdminVar_bump_version.sql','DONE','2019-04-23 11:13:27'),(64,'2019_04_23_drop_v_run_view.sql','DONE','2019-04-23 11:13:35'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; UNLOCK TABLES; @@ -195,4 +195,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-04-08 16:38:18 +-- Dump completed on 2019-04-23 12:14:11 From 8796e356f1e6da2d93caf518942d3b0e9f9bec6f Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Tue, 23 Apr 2019 13:40:43 +0100 Subject: [PATCH 3/4] Add script to SchemaStatus table --- schema/updates/2019_04_23_v_run_additional_runs.sql | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/schema/updates/2019_04_23_v_run_additional_runs.sql b/schema/updates/2019_04_23_v_run_additional_runs.sql index f30d6582..417dd0c4 100644 --- a/schema/updates/2019_04_23_v_run_additional_runs.sql +++ b/schema/updates/2019_04_23_v_run_additional_runs.sql @@ -3,13 +3,11 @@ -- other synchrotrons/facilities will have their own -- run schedule. +INSERT INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2019_04_23_v_run_additional_runs.sql', 'ONGOING'); /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; - -LOCK TABLES `v_run` WRITE; -/*!40000 ALTER TABLE `v_run` DISABLE KEYS */; -INSERT INTO `v_run` VALUES (62,'2018-03','2018-05-24 09:00:00','2018-08-10 08:59:59'),(63,'2018-04','2018-08-10 09:00:00','2018-10-26 08:59:59'),(64,'2018-05','2018-10-26 09:00:00','2018-12-18 08:59:59'),(65,'2019-01','2018-12-18 09:00:00','2019-03-08 08:59:59'),(66,'2019-02','2019-03-08 09:00:00','2019-05-23 08:59:59'),(67,'2019-03','2019-05-23 09:00:00','2019-08-09 08:59:59'); -/*!40000 ALTER TABLE `v_run` ENABLE KEYS */; -UNLOCK TABLES; +INSERT IGNORE INTO `v_run` VALUES (62,'2018-03','2018-05-24 09:00:00','2018-08-10 08:59:59'),(63,'2018-04','2018-08-10 09:00:00','2018-10-26 08:59:59'),(64,'2018-05','2018-10-26 09:00:00','2018-12-18 08:59:59'),(65,'2019-01','2018-12-18 09:00:00','2019-03-08 08:59:59'),(66,'2019-02','2019-03-08 09:00:00','2019-05-23 08:59:59'),(67,'2019-03','2019-05-23 09:00:00','2019-08-09 08:59:59'); /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2019_04_23_v_run_additional_runs.sql'; From e309484a8b0298cd74c3b36b61c67cc45736d77f Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Tue, 23 Apr 2019 13:42:58 +0100 Subject: [PATCH 4/4] Add new script to SchemaStatus table --- schema/lookups.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/lookups.sql b/schema/lookups.sql index e4a4e965..cf31aec6 100644 --- a/schema/lookups.sql +++ b/schema/lookups.sql @@ -30,7 +30,7 @@ UNLOCK TABLES; LOCK TABLES `SchemaStatus` WRITE; /*!40000 ALTER TABLE `SchemaStatus` DISABLE KEYS */; -INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'),(63,'2019_04_23_AdminVar_bump_version.sql','DONE','2019-04-23 11:13:27'),(64,'2019_04_23_drop_v_run_view.sql','DONE','2019-04-23 11:13:35'); +INSERT INTO `SchemaStatus` (`schemaStatusId`, `scriptName`, `schemaStatus`, `recordTimeStamp`) VALUES (6,'20180213_BLSample_subLocation.sql','DONE','2018-02-13 13:27:19'),(12,'20180213_DataCollectionFileAttachment_fileType.sql','DONE','2018-02-13 15:12:54'),(16,'20180303_v_run_to_table.sql','DONE','2018-07-25 15:11:18'),(19,'20180328_ImageQualityIndicators_alter_table.sql','DONE','2018-07-25 15:11:18'),(22,'20180410_BeamLineSetup_alter.sql','DONE','2018-07-25 15:11:18'),(25,'20180413_BeamLineSetup_and_Detector_alter.sql','DONE','2018-07-25 15:11:18'),(28,'20180501_DataCollectionGroup_experimentType_enum.sql','DONE','2018-07-25 15:11:18'),(31,'20180531_ScreeningOutput_alignmentSuccess.sql','DONE','2018-07-25 15:11:18'),(34,'20180629_DataCollection_imageContainerSubPath.sql','DONE','2018-07-25 15:11:18'),(35,'20180913_BeamCalendar.sql','DONE','2018-09-19 09:52:45'),(36,'2018_09_19_DataCollection_imageDirectory_comment.sql','DONE','2018-09-19 12:38:01'),(37,'2018_09_27_increase_schema_version.sql','DONE','2018-09-27 13:17:15'),(38,'2018_11_01_XrayCenteringResult.sql','DONE','2018-11-01 13:36:53'),(39,'2018_11_01_AutoProcProgram_dataCollectionId.sql','DONE','2018-11-01 15:10:38'),(40,'2018_11_01_AutoProcProgramMessage.sql','DONE','2018-11-01 15:28:17'),(44,'2018_11_01_DiffractionPlan_centeringMethod.sql','DONE','2018-11-01 22:51:36'),(45,'2018_11_02_DataCollectionGroup_experimentType_enum.sql','DONE','2018-11-02 11:54:15'),(47,'2018_11_05_spelling_of_centring.sql','DONE','2018-11-05 15:31:38'),(48,'2018_11_09_AutoProcProgram_update_processing_program.sql','DONE','2018-11-09 16:38:34'),(49,'2018_11_14_AutoProcProgramMessage_autoinc.sql','DONE','2018-11-14 10:15:27'),(50,'2018_11_22_AutoProcProgram_processingStatus_update.sql','DONE','2018-11-22 16:11:15'),(51,'2018_12_04_EnergyScan_and_XFEFluorescenceSpectrum_add_axisPosition.sql','DONE','2018-12-04 14:13:23'),(52,'2018_12_20_DataCollectionGroup_scanParameters.sql','DONE','2018-12-20 17:30:04'),(53,'2019_01_14_Proposal_state.sql','DONE','2019-01-14 12:13:31'),(54,'2019_01_14_ProcessingJobParameter_parameterValue.sql','DONE','2019-01-14 14:00:02'),(57,'2019_01_15_Detector_localName.sql','DONE','2019-01-15 23:01:15'),(58,'2019_02_04_BLSession_unique_index.sql','DONE','2019-02-04 13:52:19'),(59,'2019_03_29_BLSession_archived.sql','DONE','2019-04-03 14:43:08'),(60,'2019_04_03_UserGroup_and_Permission.sql','DONE','2019-04-03 14:51:04'),(61,'2019_04_07_AdminVar_bump_version.sql','DONE','2019-04-07 11:35:06'),(62,'2019_04_08_AdminVar_bump_version.sql','DONE','2019-04-08 15:38:01'),(63,'2019_04_23_AdminVar_bump_version.sql','DONE','2019-04-23 11:13:27'),(64,'2019_04_23_drop_v_run_view.sql','DONE','2019-04-23 11:13:35'),(67,'2019_04_23_v_run_additional_runs.sql','DONE','2019-04-23 12:39:47'); /*!40000 ALTER TABLE `SchemaStatus` ENABLE KEYS */; UNLOCK TABLES; @@ -195,4 +195,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-04-23 12:14:11 +-- Dump completed on 2019-04-23 13:40:57