-- MySQL dump 10.9
--
-- Host: localhost    Database: psmops_testing_results
-- ------------------------------------------------------
-- Server version	4.1.20

/*!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 */;
/*!40101 SET NAMES utf8 */;
/*!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 `simrun_day_results`
--

DROP TABLE IF EXISTS `simrun_day_results`;
CREATE TABLE `simrun_day_results` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `simrun_id` bigint(20) unsigned NOT NULL default '0',
  `mjd` float NOT NULL default '0',
  `cal_day` varchar(10) default NULL COMMENT 'Calendary day in form YYYY-MM-DD.',
  `ocnum` int(11) NOT NULL default '0',
  `available` int(10) unsigned NOT NULL default '0',
  `found` int(10) unsigned NOT NULL default '0',
  `unfound` int(10) unsigned NOT NULL default '0',
  `unlinked` int(10) unsigned NOT NULL default '0',
  `failed_iod` int(10) unsigned NOT NULL default '0',
  `failed_od` int(10) unsigned NOT NULL default '0',
  `synthetic` int(10) unsigned NOT NULL default '0',
  `nonsynthetic` int(10) unsigned NOT NULL default '0',
  `mixed` int(10) unsigned NOT NULL default '0',
  `clean` int(10) unsigned NOT NULL default '0',
  `bad` int(10) unsigned NOT NULL default '0',
  `precov_avail` int(10) unsigned NOT NULL default '0',
  `precov_found` int(10) unsigned NOT NULL default '0',
  `precov_mixed` int(10) unsigned NOT NULL default '0',
  `precov_bad` int(10) unsigned NOT NULL default '0',
  `precov_nonsynth` int(10) unsigned NOT NULL default '0',
  `detections` int(10) unsigned NOT NULL default '0',
  `tracklets` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `simrun_id` (`simrun_id`),
  CONSTRAINT `simrun_day_results_ibfk_3` FOREIGN KEY (`simrun_id`) REFERENCES `simrun_results` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `simrun_goals`
--

DROP TABLE IF EXISTS `simrun_goals`;
CREATE TABLE `simrun_goals` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `simrun_id` bigint(20) unsigned NOT NULL default '0',
  `goal` varchar(255) NOT NULL default '',
  `pass` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `simrun_id` (`simrun_id`),
  CONSTRAINT `simrun_goals_ibfk_3` FOREIGN KEY (`simrun_id`) REFERENCES `simrun_results` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `simrun_results`
--

DROP TABLE IF EXISTS `simrun_results`;
CREATE TABLE `simrun_results` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `simtest_id` bigint(20) unsigned NOT NULL default '0',
  `dt_wall` float unsigned NOT NULL default '0' COMMENT '[s]',
  `dt_cpu` float unsigned NOT NULL default '0' COMMENT '[s]',
  `lod_wall` float unsigned NOT NULL default '0' COMMENT '[s]',
  `lod_cpu` float unsigned NOT NULL default '0' COMMENT '[s]',
  `precov_wall` float unsigned NOT NULL default '0' COMMENT '[s]',
  `precov_cpu` float unsigned NOT NULL default '0' COMMENT '[s]',
  PRIMARY KEY  (`id`),
  KEY `simtest_id` (`simtest_id`),
  CONSTRAINT `simrun_results_ibfk_4` FOREIGN KEY (`simtest_id`) REFERENCES `simtest_results` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `simtest_results`
--

DROP TABLE IF EXISTS `simtest_results`;
CREATE TABLE `simtest_results` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `test_run` bigint(20) unsigned NOT NULL default '0',
  `instance_name` varchar(255) NOT NULL default '' COMMENT 'Name of the PS-MOPS instance.',
  `ssm` varchar(128) NOT NULL default '' COMMENT 'Solar system model.',
  `survey` varchar(7) NOT NULL default '' COMMENT 'Name of survey to be used.',
  `configuration` varchar(255) NOT NULL default '' COMMENT 'PS-MOPS configuration file.',
  `simtest_config` varchar(255) NOT NULL default '' COMMENT 'Name of Simtest configuration file.',
  PRIMARY KEY  (`id`),
  KEY `test_run` (`test_run`),
  CONSTRAINT `simtest_results_ibfk_3` FOREIGN KEY (`test_run`) REFERENCES `test_runs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `test_runs`
--

DROP TABLE IF EXISTS `test_runs`;
CREATE TABLE `test_runs` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `time` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Time that test results were reported.',
  `user` varchar(32) default NULL COMMENT 'Username running the tests.',
  `type` char(3) default NULL,
  `report` tinyint(4) default '0' COMMENT 'Flag indicated test run will be included in a report.',
  `log_filename` text COMMENT 'Filename of log for Test Run.',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `test_versions`
--

DROP TABLE IF EXISTS `test_versions`;
CREATE TABLE `test_versions` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `test_run_id` bigint(20) unsigned NOT NULL default '0',
  `module` varchar(255) NOT NULL default '',
  `module_md5` varchar(128) default NULL,
  `cvs_version` varchar(16) NOT NULL default '',
  `cvs_time` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`),
  KEY `test_run_id` (`test_run_id`),
  CONSTRAINT `test_versions_ibfk_2` FOREIGN KEY (`test_run_id`) REFERENCES `test_runs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `unit_test_results`
--

DROP TABLE IF EXISTS `unit_test_results`;
CREATE TABLE `unit_test_results` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `test_run` bigint(20) unsigned NOT NULL default '0' COMMENT 'Matches id in table test_runs.',
  `number` int(10) unsigned NOT NULL default '0',
  `psmops_function` tinyint(4) NOT NULL default '0' COMMENT '1 if a testing a specific PSMOPS function, else 0.',
  `module` varchar(255) NOT NULL default '' COMMENT 'Fully-qualified module name.',
  `cvs_version` varchar(16) NOT NULL default '',
  `cvs_time` datetime default NULL,
  `test` varchar(128) NOT NULL default '',
  `modifier1` varchar(128) default NULL,
  `modifier2` varchar(128) default NULL,
  `result` char(1) default NULL COMMENT '''P'' for pass, ''F'' for fail, ''N'' for not implemented.',
  `wall` float NOT NULL default '0',
  `cpu` float NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `test_run` (`test_run`),
  CONSTRAINT `unit_test_results_ibfk_2` FOREIGN KEY (`test_run`) REFERENCES `test_runs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

