-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb5+lenny3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 13, 2010 at 01:31 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6-1+lenny6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `resultsdb`
--

-- --------------------------------------------------------

--
-- Table structure for table `Job`
--

DROP TABLE IF EXISTS `Job`;
CREATE TABLE IF NOT EXISTS `Job` (
	  `id` int(11) NOT NULL auto_increment,
	  `testplan_id` int(11) default NULL,
	  PRIMARY KEY  (`id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

	--
-- Dumping data for table `Job`
--


-- --------------------------------------------------------

--
-- Table structure for table `Result`
--

DROP TABLE IF EXISTS `Result`;
CREATE TABLE IF NOT EXISTS `Result` (
	  `id` int(11) NOT NULL auto_increment,
	  `result` varchar(30) NOT NULL,
	  PRIMARY KEY  (`id`),
	  UNIQUE KEY `result` (`result`)
	) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

	--
-- Dumping data for table `Result`
--

INSERT INTO `Result` (`id`, `result`) VALUES
(0, 'RUNNING'),
(1, 'PASSED'),
(2, 'INFO'),
(3, 'FAILED'),
(4, 'ABORTED'),
(5, 'CRASHED'),
(6, 'WAIVED'),
(7, 'NEEDS_INSPECTION');

-- --------------------------------------------------------

--
-- Table structure for table `Tag`
--

DROP TABLE IF EXISTS `Tag`;
CREATE TABLE IF NOT EXISTS `Tag` (
	  `id` int(11) NOT NULL auto_increment,
	  `tag` varchar(80) NOT NULL,
	  PRIMARY KEY  (`id`),
	  UNIQUE KEY `tag` (`tag`)
	) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

	--
-- Dumping data for table `Tag`
--

INSERT INTO `Tag` (`id`, `tag`) VALUES
(1, 'InstallTest'),
(2, 'PackageTest'),
(3, 'RepoTest'),
(4, 'Waived'),
(5, 'Re-run');

-- --------------------------------------------------------

--
-- Table structure for table `Test`
--

DROP TABLE IF EXISTS `Test`;
CREATE TABLE IF NOT EXISTS `Test` (
	  `id` int(11) NOT NULL auto_increment,
	  `url` text NOT NULL,
	  PRIMARY KEY  (`id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

	--
-- Dumping data for table `Test`
--


-- --------------------------------------------------------

--
-- Table structure for table `Testplan`
--

DROP TABLE IF EXISTS `Testplan`;
CREATE TABLE IF NOT EXISTS `Testplan` (
	  `id` int(11) NOT NULL auto_increment,
	  `url` text NOT NULL,
	  PRIMARY KEY  (`id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

	--
-- Dumping data for table `Testplan`
--


-- --------------------------------------------------------

--
-- Table structure for table `Testrun`
--

DROP TABLE IF EXISTS `Testrun`;
CREATE TABLE IF NOT EXISTS `Testrun` (
	  `id` int(11) NOT NULL auto_increment,
	  `test_id` int(11) NOT NULL,
	  `result_id` int(11) NOT NULL,
	  `start_time` timestamp NULL default NULL,
	  `end_time` timestamp NULL default NULL,
	  `summary` mediumtext,
	  `highlights` mediumtext,
	  `score` tinyint(4) NOT NULL default '0',
	  `log` text,
	  PRIMARY KEY  (`id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

	--
-- Dumping data for table `Testrun`
--


-- --------------------------------------------------------

--
-- Table structure for table `TestrunData`
--

DROP TABLE IF EXISTS `TestrunData`;
CREATE TABLE IF NOT EXISTS `TestrunData` (
	  `testrun_id` int(11) NOT NULL COMMENT 'FK',
	  `key` text NOT NULL,
	  `value` text NOT NULL,
	  PRIMARY KEY  (`testrun_id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `TestrunData`
--


-- --------------------------------------------------------

--
-- Table structure for table `TestrunPhase`
--

DROP TABLE IF EXISTS `TestrunPhase`;
CREATE TABLE IF NOT EXISTS `TestrunPhase` (
	  `id` int(11) NOT NULL auto_increment,
	  `testrun_id` int(11) NOT NULL,
	  `result_id` int(11) NOT NULL,
	  `name` tinytext NOT NULL,
	  PRIMARY KEY  (`id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

	--
-- Dumping data for table `TestrunPhase`
--


-- --------------------------------------------------------

--
-- Table structure for table `Waive`
--

DROP TABLE IF EXISTS `Waive`;
CREATE TABLE IF NOT EXISTS `Waive` (
	  `testrun_id` int(11) NOT NULL COMMENT 'FK',
	  `waived_by` varchar(255) NOT NULL,
	  `reason` text NOT NULL,
	  `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
	  `old_result_id` int(11) NOT NULL COMMENT 'fk',
	  PRIMARY KEY  (`testrun_id`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `Waive`
--


-- --------------------------------------------------------

--
-- Table structure for table `_job_testrun`
--

DROP TABLE IF EXISTS `_job_testrun`;
CREATE TABLE IF NOT EXISTS `_job_testrun` (
	  `job_id` int(11) NOT NULL,
	  `testrun_id` int(11) NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `_job_testrun`
--


-- --------------------------------------------------------

--
-- Table structure for table `_testplan_tag`
--

DROP TABLE IF EXISTS `_testplan_tag`;
CREATE TABLE IF NOT EXISTS `_testplan_tag` (
	  `testplan_id` int(11) NOT NULL,
	  `tag_id` int(11) NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `_testplan_tag`
--


-- --------------------------------------------------------

--
-- Table structure for table `_testrun_tag`
--

DROP TABLE IF EXISTS `_testrun_tag`;
CREATE TABLE IF NOT EXISTS `_testrun_tag` (
	  `testrun_id` int(11) NOT NULL,
	  `tag_id` int(11) NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `_testrun_tag`
--


-- --------------------------------------------------------

--
-- Table structure for table `_test_tag`
--

DROP TABLE IF EXISTS `_test_tag`;
CREATE TABLE IF NOT EXISTS `_test_tag` (
	  `test_id` int(11) NOT NULL,
	  `tag_id` int(11) NOT NULL
	) ENGINE=MyISAM DEFAULT CHARSET=utf8;

	--
-- Dumping data for table `_test_tag`
--


