forked from sherbold/atoml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_mysql_schema.sql
76 lines (71 loc) · 4.52 KB
/
create_mysql_schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
CREATE DATABASE `atoml` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE TABLE `results_morphtests` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`algorithm` varchar(200) NOT NULL,
`parameters` varchar(2000) DEFAULT NULL,
`testcase` varchar(200) DEFAULT NULL,
`iteration` int(11) DEFAULT NULL,
`testsize` int(11) DEFAULT NULL,
`deviations_counts` int(11) DEFAULT NULL,
`deviations_scores` int(11) DEFAULT NULL,
`pval_counts` double DEFAULT NULL,
`pval_scores` double DEFAULT NULL,
`passed_exact_score` tinyint(1) DEFAULT NULL,
`passed_exact_class` tinyint(1) DEFAULT NULL,
`passed_stat_class` tinyint(1) DEFAULT NULL,
`passed_stat_score` tinyint(1) DEFAULT NULL,
`passed` tinyint(1) DEFAULT NULL,
`time` bigint(20) DEFAULT NULL,
`exception` varchar(200) DEFAULT NULL,
`message` varchar(1000) DEFAULT NULL,
`stacktrace` longtext DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26590 DEFAULT CHARSET=latin1;
CREATE TABLE `results_smoketests` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`algorithm` varchar(200) NOT NULL,
`parameters` varchar(2000) DEFAULT NULL,
`testcase` varchar(200) DEFAULT NULL,
`iteration` int(11) DEFAULT NULL,
`passed` tinyint(1) DEFAULT NULL,
`time` bigint(20) DEFAULT NULL,
`exception` varchar(200) DEFAULT NULL,
`message` varchar(1000) DEFAULT NULL,
`stacktrace` longtext DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25514 DEFAULT CHARSET=latin1;
CREATE VIEW `morphtest_view` AS select
`results_morphtests`.`id` AS `id`,
case when `results_morphtests`.`algorithm` like 'test%' then substring_index(substr(`results_morphtests`.`algorithm`, locate('_',`results_morphtests`.`algorithm`) + 1), '_', 1) else substring_index(`results_morphtests`.`algorithm`,'_',1) end AS `framework`,
case when `results_morphtests`.`algorithm` like 'test%' then substr(`results_morphtests`.`algorithm`, length(substring_index(`results_morphtests`.`algorithm`, '_', 2)) + 2) else substr(`results_morphtests`.`algorithm`,locate('_',`results_morphtests`.`algorithm`) + 1,char_length(`results_morphtests`.`algorithm`) - locate('_',reverse(`results_morphtests`.`algorithm`)) - locate('_',`results_morphtests`.`algorithm`)) end AS `algorithm`,
`results_morphtests`.`parameters` AS `parameters`,
substring_index(substring_index(`results_morphtests`.`testcase`,'_',-2),'_',1) AS `testcase`,
substring_index(`results_morphtests`.`testcase`,'_',-1) AS `dataset`,`results_morphtests`.`iteration` AS `iteration`,
`results_morphtests`.`testsize` AS `testsize`,
`results_morphtests`.`deviations_counts` AS `deviations_counts`,
`results_morphtests`.`deviations_scores` AS `deviations_scores`,
`results_morphtests`.`pval_counts` AS `pval_counts`,
`results_morphtests`.`pval_scores` AS `pval_scores`,
`results_morphtests`.`passed_exact_score` AS `passed_exact_score`,
`results_morphtests`.`passed_exact_class` AS `passed_exact_class`,
`results_morphtests`.`passed_stat_class` AS `passed_stat_class`,
`results_morphtests`.`passed_stat_score` AS `passed_stat_score`,
`results_morphtests`.`passed` AS `passed`,
`results_morphtests`.`time` AS `time`,
`results_morphtests`.`exception` AS `exception`,
`results_morphtests`.`message` AS `message`,
`results_morphtests`.`stacktrace` AS `stacktrace`
from `results_morphtests`;
CREATE VIEW `smoketest_view` AS select
`results_smoketests`.`id` AS `id`,
case when `results_smoketests`.`algorithm` like 'test%' then substring_index(substr(`results_smoketests`.`algorithm`, locate('_',`results_smoketests`.`algorithm`) + 1), '_', 1) else substring_index(`results_smoketests`.`algorithm`,'_',1) end AS `framework`,
case when `results_smoketests`.`algorithm` like 'test%' then substr(`results_smoketests`.`algorithm`, length(substring_index(`results_smoketests`.`algorithm`, '_', 2)) + 2) else substr(`results_smoketests`.`algorithm`,locate('_',`results_smoketests`.`algorithm`) + 1,char_length(`results_smoketests`.`algorithm`) - locate('_',reverse(`results_smoketests`.`algorithm`)) - locate('_',`results_smoketests`.`algorithm`)) end AS `algorithm`,
`results_smoketests`.`parameters` AS `parameters`,
substring_index(`results_smoketests`.`testcase`,'_',-1) AS `testcase`,
`results_smoketests`.`iteration` AS `iteration`,
`results_smoketests`.`passed` AS `passed`,
`results_smoketests`.`time` AS `time`,
`results_smoketests`.`exception` AS `exception`,
`results_smoketests`.`message` AS `message`,
`results_smoketests`.`stacktrace` AS `stacktrace`
from `results_smoketests`;