To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 1dbf731d authored by Reto Da Forno's avatar Reto Da Forno

DB schema updated

parent ae7543d7
-- MySQL dump 10.15 Distrib 10.0.29-MariaDB, for debian-linux-gnu (x86_64)
-- MySQL dump 10.16 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: taugwalder Database: taugwalder
-- Host: localhost Database: flocklab
-- ------------------------------------------------------
-- Server version 5.7.17-log
-- Server version 5.7.16-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
......@@ -15,13 +15,12 @@
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `flocklab`
-- Select the database 'flocklab'
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `flocklab` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `flocklab`;
USE flocklab;
--
-- Table structure for table `tbl_serv_architectures`
......@@ -41,7 +40,7 @@ CREATE TABLE `tbl_serv_architectures` (
PRIMARY KEY (`serv_architectures_key`),
KEY `fk_tbl_serv_targetimages_platform` (`platforms_fk`),
CONSTRAINT `fk_tbl_serv_architectures_platform` FOREIGN KEY (`platforms_fk`) REFERENCES `tbl_serv_platforms` (`serv_platforms_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -64,7 +63,7 @@ CREATE TABLE `tbl_serv_dispatcher_activity` (
KEY `fk_tbl_serv_dispatcher_activity_tests` (`test_fk`),
CONSTRAINT `fk_tbl_serv_dispatcher_activity_observer` FOREIGN KEY (`observer_fk`) REFERENCES `tbl_serv_observer` (`serv_observer_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_dispatcher_activity_tests` FOREIGN KEY (`test_fk`) REFERENCES `tbl_serv_tests` (`serv_tests_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=1181 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -90,7 +89,7 @@ CREATE TABLE `tbl_serv_errorlog` (
KEY `fk_tbl_serv_errorlog_services` (`service_fk`),
CONSTRAINT `fk_tbl_serv_errorlog_observer` FOREIGN KEY (`observer_fk`) REFERENCES `tbl_serv_observer` (`serv_observer_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_errorlog_tests` FOREIGN KEY (`test_fk`) REFERENCES `tbl_serv_tests` (`serv_tests_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=17984 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=38621 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -120,7 +119,7 @@ CREATE TABLE `tbl_serv_locks` (
`expiry_time` datetime NOT NULL,
PRIMARY KEY (`tbl_serv_locks_key`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=2935 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -155,12 +154,13 @@ CREATE TABLE `tbl_serv_observer` (
`serv_observer_key` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ethernet_address` varchar(60) COLLATE utf8_bin NOT NULL,
`observer_id` int(11) NOT NULL,
`status` enum('online','offline','disabled','develop', 'internal') COLLATE utf8_bin NOT NULL DEFAULT 'disabled',
`status` enum('online','offline','disabled','develop','internal') CHARACTER SET utf8 NOT NULL DEFAULT 'disabled',
`slot_1_tg_adapt_list_fk` int(10) unsigned DEFAULT NULL,
`slot_2_tg_adapt_list_fk` int(10) unsigned DEFAULT NULL,
`slot_3_tg_adapt_list_fk` int(10) unsigned DEFAULT NULL,
`slot_4_tg_adapt_list_fk` int(10) unsigned DEFAULT NULL,
`last_changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`sync_method` enum('cc430gps','cc430glossy','gps') COLLATE utf8_bin NOT NULL DEFAULT 'cc430glossy',
PRIMARY KEY (`serv_observer_key`),
KEY `fk_slot_2` (`slot_2_tg_adapt_list_fk`),
KEY `fk_slot_3` (`slot_3_tg_adapt_list_fk`),
......@@ -245,7 +245,7 @@ CREATE TABLE `tbl_serv_platforms` (
`freq_433` tinyint(1) NOT NULL DEFAULT '0',
`last_changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`serv_platforms_key`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -263,7 +263,7 @@ CREATE TABLE `tbl_serv_reservations` (
PRIMARY KEY (`serv_reservation_key`),
KEY `fk_tbl_serv_reservations` (`group_id_fk`),
CONSTRAINT `fk_tbl_serv_reservations_groups` FOREIGN KEY (`group_id_fk`) REFERENCES `tbl_serv_groups` (`serv_groups_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=304 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB AUTO_INCREMENT=525 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -285,7 +285,7 @@ CREATE TABLE `tbl_serv_resource_allocation` (
KEY `fk_tbl_serv_resource_allocation_tests` (`test_fk`),
CONSTRAINT `fk_tbl_serv_resource_allocation_observer` FOREIGN KEY (`observer_fk`) REFERENCES `tbl_serv_observer` (`serv_observer_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_resource_allocation_tests` FOREIGN KEY (`test_fk`) REFERENCES `tbl_serv_tests` (`serv_tests_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=2289 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -330,7 +330,7 @@ CREATE TABLE `tbl_serv_targetimages` (
CONSTRAINT `fk_tbl_serv_targetimages_os` FOREIGN KEY (`operatingsystems_fk`) REFERENCES `tbl_serv_operatingsystems` (`serv_operatingsystems_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_targetimages_platform` FOREIGN KEY (`platforms_fk`) REFERENCES `tbl_serv_platforms` (`serv_platforms_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_targetimages_users` FOREIGN KEY (`owner_fk`) REFERENCES `tbl_serv_users` (`serv_users_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=19674 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=33510 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -360,7 +360,7 @@ CREATE TABLE `tbl_serv_tests` (
PRIMARY KEY (`serv_tests_key`),
KEY `fk_tbl_serv_test_owner` (`owner_fk`),
CONSTRAINT `fk_tbl_serv_test_owner` FOREIGN KEY (`owner_fk`) REFERENCES `tbl_serv_users` (`serv_users_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=36490 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=64162 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -379,7 +379,7 @@ CREATE TABLE `tbl_serv_tg_adapt_list` (
PRIMARY KEY (`serv_tg_adapt_list_key`),
KEY `fk_tbl_serv_tg_adapt_types` (`tg_adapt_types_fk`),
CONSTRAINT `fk_tbl_serv_tg_adapt_types` FOREIGN KEY (`tg_adapt_types_fk`) REFERENCES `tbl_serv_tg_adapt_types` (`serv_tg_adapt_types_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=245 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table keeps an up-to-date list of every serial ID which belo';
) ENGINE=InnoDB AUTO_INCREMENT=310 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table keeps an up-to-date list of every serial ID which belo';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -398,7 +398,7 @@ CREATE TABLE `tbl_serv_tg_adapt_types` (
PRIMARY KEY (`serv_tg_adapt_types_key`),
KEY `fk_tbl_serv_tg_adapt_types_1` (`platforms_fk`),
CONSTRAINT `fk_tbl_serv_tg_adapt_types_1` FOREIGN KEY (`platforms_fk`) REFERENCES `tbl_serv_platforms` (`serv_platforms_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -417,7 +417,7 @@ CREATE TABLE `tbl_serv_user_groups` (
KEY `fk_tbl_serv_user_groups_groups` (`group_fk`),
CONSTRAINT `fk_tbl_serv_user_groups` FOREIGN KEY (`user_fk`) REFERENCES `tbl_serv_users` (`serv_users_key`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_serv_user_groups_groups` FOREIGN KEY (`group_fk`) REFERENCES `tbl_serv_groups` (`serv_groups_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -435,21 +435,21 @@ CREATE TABLE `tbl_serv_users` (
`country` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`institution_type` ENUM('university', 'researchinstitute', 'company', 'other') NOT NULL DEFAULT 'other',
`institution_type` enum('university','researchinstitute','company','other') CHARACTER SET utf8 NOT NULL DEFAULT 'other',
`institution` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`quota_runtime` int(11) NOT NULL DEFAULT '60' COMMENT 'Runtime per test in minutes',
`quota_tests` int(11) NOT NULL DEFAULT '3' COMMENT 'Max no. of tests to be scheduled',
`retention_time` int(11) NOT NULL DEFAULT '60' COMMENT 'Retention time for testresults in days. After this time, all testresults are deleted. A value of -1 means that tests should be kept infinitely.',
`role` ENUM('user', 'admin', 'internal') NOT NULL DEFAULT 'user',
`role` enum('user','admin','internal') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user',
`is_active` tinyint(4) NOT NULL DEFAULT '1',
`create_time` datetime NOT NULL,
`last_login` datetime DEFAULT NULL,
`login_count` int(11) NOT NULL DEFAULT '0',
`disable_infomails` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'If set to 1, the user wwill not get emails which just inform about the status of a test. Emails with warnings/errors will still be sent though.',
`disable_infomails` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'If set to 1, the user will not get emails which just inform about the status of a test. Emails with warnings/errors will still be sent though.',
`last_changed` datetime DEFAULT NULL,
`use_daq` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`serv_users_key`)
) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=InnoDB AUTO_INCREMENT=370 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -472,7 +472,7 @@ CREATE TABLE `tbl_serv_web_link_measurements` (
KEY `fk_tbl_serv_web_link_measurements_platforms` (`platform_fk`),
KEY `radio` (`radio`),
CONSTRAINT `fk_tbl_serv_web_link_measurements_platforms` FOREIGN KEY (`platform_fk`) REFERENCES `tbl_serv_platforms` (`serv_platforms_key`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=9784 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) ENGINE=InnoDB AUTO_INCREMENT=13880 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -492,7 +492,7 @@ CREATE TABLE `tbl_serv_web_status` (
`ui_lock` enum('false','true') COLLATE utf8_bin NOT NULL DEFAULT 'false',
PRIMARY KEY (`serv_web_status_key`),
UNIQUE KEY `serv_web_status_key_UNIQUE` (`serv_web_status_key`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table used to show status information to flocklab users on w';
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table used to show status information to flocklab users on w';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......@@ -504,4 +504,4 @@ CREATE TABLE `tbl_serv_web_status` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-03-02 10:52:21
-- Dump completed on 2019-02-28 14:13:08
# users
select count(*) from tbl_serv_users;
# of different institutions
# select count(distinct institution) from tbl_serv_users;
select institution, count(institution) from tbl_serv_users group by institution;
# of tests / test time
select time_start_wish from tbl_serv_tests order by time_start_wish limit 1;
select count(*) from tbl_serv_tests where test_status_preserved in ('finished', 'failed', 'retention expiring', 'synced') or test_status_preserved is null;
select min(time_start_act), max(time_end_act), max(time_end_act - time_start_act), sum(time_end_act - time_start_act) as duration from tbl_serv_tests where (test_status_preserved in ('finished', 'failed', 'retention expiring', 'synced') or test_status_preserved is null) and (time_end_act is not null and time_start_act is not null and time_start_act < time_end_act and time_end_act - time_start_act < 72 * 3600 and time_end_act<'2013-10-01 00:00:00');
select min(time_start_act), max(time_end_act), max(time_end_act - time_start_act), sum(time_end_act - time_start_act) as duration from tbl_serv_tests where (test_status_preserved in ('finished', 'failed', 'retention expiring', 'synced') or test_status_preserved is null) and (time_end_act is not null and time_start_act is not null and time_start_act < time_end_act and time_end_act - time_start_act < 72 * 3600);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment