-- phpMyAdmin SQL Dump
-- version 2.11.2
-- http://www.phpmyadmin.net
--
-- Počítač: localhost
-- Vygenerováno: Neděle 25. května 2008, 21:32
-- Verze MySQL: 4.1.22
-- Verze PHP: 5.2.4

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Databáze: `webdoc`
--
CREATE DATABASE `webdoc` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `webdoc`;

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

--
-- Struktura tabulky `file_list`
--

CREATE TABLE IF NOT EXISTS `file_list` (
  `file_list_id` int(10) unsigned NOT NULL auto_increment,
  `table_id` varchar(255) NOT NULL default '',
  `record_id` int(10) unsigned NOT NULL default '0',
  `creator_id` int(10) unsigned NOT NULL default '0',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `remover_id` int(10) unsigned default NULL,
  `removed` datetime default NULL,
  `file_name` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`file_list_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `file_list`
--


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

--
-- Struktura tabulky `person`
--

CREATE TABLE IF NOT EXISTS `person` (
  `person_id` int(10) unsigned NOT NULL auto_increment,
  `login` varchar(255) default NULL,
  `pass` varchar(40) default NULL,
  `role_id` int(10) unsigned default NULL,
  `name` varchar(255) default NULL,
  `surname` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `register_id` int(10) unsigned default NULL,
  `register_time` datetime default NULL,
  `active` tinyint(1) default NULL,
  PRIMARY KEY  (`person_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

--
-- Vypisuji data pro tabulku `person`
--

INSERT INTO `person` (`person_id`, `login`, `pass`, `role_id`, `name`, `surname`, `email`, `register_id`, `register_time`, `active`) VALUES
(1, 'root', '435b41068e8665513a20070c033b08b9c66e4332', 1, 'root', 'root', 'root@localhost.cz', 1, '2008-03-24 19:57:57', 1);

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

--
-- Struktura tabulky `person_role`
--

CREATE TABLE IF NOT EXISTS `person_role` (
  `role_id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`role_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Vypisuji data pro tabulku `person_role`
--

INSERT INTO `person_role` (`role_id`, `name`) VALUES
(1, 'da'),
(2, 'de'),
(3, 'ta'),
(4, 'te'),
(5, 'tt');

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

--
-- Struktura tabulky `priorities`
--

CREATE TABLE IF NOT EXISTS `priorities` (
  `priority_id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`priority_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;

--
-- Vypisuji data pro tabulku `priorities`
--

INSERT INTO `priorities` (`priority_id`, `name`) VALUES
(0, '0'),
(1, '1'),
(2, '2'),
(3, '3'),
(4, '4'),
(5, '5'),
(6, '6'),
(7, '7'),
(8, '8'),
(9, '9'),
(10, '10');

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

--
-- Struktura tabulky `product`
--

CREATE TABLE IF NOT EXISTS `product` (
  `product_id` int(10) unsigned NOT NULL auto_increment,
  `sequence_id` int(10) unsigned NOT NULL default '0',
  `version` int(11) NOT NULL default '0',
  `category_id` int(10) unsigned default NULL,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `creator_id` int(10) unsigned NOT NULL default '0',
  `approved` datetime default NULL,
  `approver_id` int(10) unsigned default NULL,
  `name` varchar(200) NOT NULL default '',
  `description` text NOT NULL,
  `comments` text NOT NULL,
  PRIMARY KEY  (`product_id`),
  KEY `product_FKIndex1` (`category_id`),
  KEY `product_FKIndex3` (`creator_id`),
  KEY `product_FKIndex4` (`approver_id`),
  KEY `product_FKIndex5` (`sequence_id`),
  FULLTEXT KEY `description` (`description`),
  FULLTEXT KEY `comments` (`comments`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `product`
--


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

--
-- Struktura tabulky `product_category`
--

CREATE TABLE IF NOT EXISTS `product_category` (
  `category_id` int(10) unsigned NOT NULL auto_increment,
  `parent_id` int(10) unsigned default NULL,
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `person_id` int(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL,
  PRIMARY KEY  (`category_id`),
  KEY `family_FKIndex1` (`person_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `product_category`
--


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

--
-- Struktura tabulky `product_parent`
--

CREATE TABLE IF NOT EXISTS `product_parent` (
  `sequence_id` int(10) unsigned NOT NULL auto_increment,
  `parent_id` int(10) unsigned default NULL,
  PRIMARY KEY  (`sequence_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `product_parent`
--


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

--
-- Struktura tabulky `requirement`
--

CREATE TABLE IF NOT EXISTS `requirement` (
  `requirement_id` int(10) unsigned NOT NULL auto_increment,
  `category_id` int(10) unsigned default NULL,
  `sequence_id` int(10) unsigned NOT NULL default '0',
  `version` int(10) unsigned NOT NULL default '0',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `creator_id` int(10) unsigned NOT NULL default '0',
  `approved` datetime default NULL,
  `approver_id` int(10) unsigned default NULL,
  `name` varchar(200) NOT NULL default '',
  `description` text NOT NULL,
  `active` tinyint(1) NOT NULL default '0',
  `comments` text NOT NULL,
  `is_product_specific` tinyint(1) default NULL,
  PRIMARY KEY  (`requirement_id`),
  KEY `requirement_FKIndex1` (`category_id`),
  KEY `requirement_FKIndex4` (`creator_id`),
  KEY `requirement_FKIndex5` (`approver_id`),
  FULLTEXT KEY `name` (`name`),
  FULLTEXT KEY `description` (`description`),
  FULLTEXT KEY `comments` (`comments`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement`
--


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

--
-- Struktura tabulky `requirement_category`
--

CREATE TABLE IF NOT EXISTS `requirement_category` (
  `category_id` int(10) unsigned NOT NULL auto_increment,
  `parent_id` int(10) unsigned default '0',
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `person_id` int(10) unsigned NOT NULL default '0',
  `name` varchar(200) NOT NULL default '',
  `description` text NOT NULL,
  PRIMARY KEY  (`category_id`),
  KEY `cathegory_FKIndex2` (`person_id`),
  KEY `requirement_cathegory_index1` (`parent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement_category`
--


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

--
-- Struktura tabulky `requirement_dependence`
--

CREATE TABLE IF NOT EXISTS `requirement_dependence` (
  `requirement_dependence_id` int(10) unsigned NOT NULL auto_increment,
  `requirement_id` int(10) unsigned NOT NULL default '0',
  `dependence_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`requirement_dependence_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement_dependence`
--


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

--
-- Struktura tabulky `requirement_has_product`
--

CREATE TABLE IF NOT EXISTS `requirement_has_product` (
  `requirement_has_product_id` int(10) unsigned NOT NULL auto_increment,
  `product_id` int(10) unsigned NOT NULL default '0',
  `requirement_id` int(10) unsigned NOT NULL default '0',
  `sequence_id` int(10) unsigned NOT NULL default '0',
  `version` int(11) NOT NULL default '0',
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `person_id` int(10) unsigned NOT NULL default '0',
  `state_id` int(10) unsigned NOT NULL default '0',
  `priority_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`requirement_has_product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement_has_product`
--


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

--
-- Struktura tabulky `requirement_has_test`
--

CREATE TABLE IF NOT EXISTS `requirement_has_test` (
  `requirement_has_test_id` int(10) unsigned NOT NULL auto_increment,
  `requirement_id` int(10) unsigned NOT NULL default '0',
  `test_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`requirement_has_test_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement_has_test`
--


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

--
-- Struktura tabulky `requirement_parent`
--

CREATE TABLE IF NOT EXISTS `requirement_parent` (
  `sequence_id` int(10) unsigned NOT NULL auto_increment,
  `parent_id` int(10) unsigned default NULL,
  PRIMARY KEY  (`sequence_id`),
  KEY `requirement_parent_index1` (`parent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `requirement_parent`
--


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

--
-- Struktura tabulky `states`
--

CREATE TABLE IF NOT EXISTS `states` (
  `state_id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`state_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Vypisuji data pro tabulku `states`
--

INSERT INTO `states` (`state_id`, `name`) VALUES
(1, 'assigned'),
(2, 'approved'),
(3, 'implemented'),
(4, 'tested'),
(5, 'removed');

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

--
-- Struktura tabulky `test`
--

CREATE TABLE IF NOT EXISTS `test` (
  `test_id` int(10) unsigned NOT NULL auto_increment,
  `sequence_id` int(11) NOT NULL default '0',
  `version` int(11) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `creator_id` int(10) unsigned NOT NULL default '0',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `approver_id` int(10) unsigned default NULL,
  `approved` datetime default NULL,
  `acceptance_criteria` text,
  `comments` text,
  `terminator_id` int(10) default NULL,
  `terminate` datetime default NULL,
  PRIMARY KEY  (`test_id`),
  FULLTEXT KEY `name` (`name`),
  FULLTEXT KEY `acceptance_criteria` (`acceptance_criteria`),
  FULLTEXT KEY `comments` (`comments`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `test`
--


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

--
-- Struktura tabulky `test_run`
--

CREATE TABLE IF NOT EXISTS `test_run` (
  `test_run_id` int(10) unsigned NOT NULL auto_increment,
  `product_id` int(10) unsigned default NULL,
  `test_id` int(10) unsigned default NULL,
  `name` varchar(255) NOT NULL default '',
  `creator_id` int(10) unsigned NOT NULL default '0',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `tester_id` int(10) unsigned default NULL,
  `tested` datetime default NULL,
  `approver_id` int(10) unsigned default NULL,
  `approved` datetime default NULL,
  `sw_rev` varchar(255) default NULL,
  `hw_rev` varchar(255) default NULL,
  `setup` text NOT NULL,
  `result` text,
  `duration` varchar(255) default NULL,
  `description` text,
  PRIMARY KEY  (`test_run_id`),
  KEY `test_case_FKIndex2` (`test_id`),
  FULLTEXT KEY `name` (`name`),
  FULLTEXT KEY `sw_rev` (`sw_rev`),
  FULLTEXT KEY `hw_rev` (`hw_rev`),
  FULLTEXT KEY `setup` (`setup`),
  FULLTEXT KEY `result` (`result`),
  FULLTEXT KEY `duration` (`duration`),
  FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Vypisuji data pro tabulku `test_run`
--


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

--
-- Struktura tabulky `text`
--

CREATE TABLE IF NOT EXISTS `text` (
  `text_id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`text_id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=78 ;

--
-- Vypisuji data pro tabulku `text`
--

INSERT INTO `text` (`text_id`, `name`, `text`) VALUES
(1, 'no_permission', 'Sorry, but you have not access permission or you are not active.'),
(2, 'fail_db_connect', 'Sorry, fail connect to database.'),
(5, 'bad_auth', 'Sorry, your login wasn`t successful. Bad Name or Password. Or you are not active.'),
(6, 'error_saving', 'Get an error during saving.'),
(7, 'error_edit', 'Get an error during edit action.'),
(8, 'error_delete', 'Get an error during delete action.'),
(9, 'filled_login', 'Field Login must be filled.'),
(10, 'filled_pass', 'Field Pass must be filled.'),
(11, 'new_user', 'New user was successfuly added.'),
(12, 'edit_user', 'User was successfuly edited.'),
(13, 'delete_user', 'User was successfuly deleted.'),
(14, 'exists_login', 'Login is already exists.'),
(15, 'email_correct', 'E-mail is not correct.'),
(16, 'filled_pass_again', 'Field Pass again must be filled.'),
(17, 'filled_role', 'Field Role must be filled.'),
(18, 'filled_name', 'Field Name must be filled.'),
(19, 'filled_surname', 'Field Surname must be filled.'),
(20, 'filled_email', 'Field E-mail must be filled.'),
(21, 'pass_not_match', 'Passwords did not match.'),
(22, 'record_saved', 'Record was saved.'),
(23, 'record_not_found', 'Sorry, the requested record was not found.'),
(24, 'filled_description', 'Field Description must be filled.'),
(25, 'list_empty', 'List is empty.'),
(26, 'template_not_found', 'Sorry, the requested template was not found.'),
(27, 'change_pass', 'Your password has been changed. Please, log out and log in with new password.'),
(28, 'bad_parent', 'Selected parent is bad.'),
(29, 'record_delete', 'Do you want to delete this record?'),
(30, 'record_deleted', 'Record was deleted.'),
(31, 'yes', 'Yes'),
(32, 'no', 'No'),
(33, 'category_not_empty', 'This category is impossible to delete, because is not empty. '),
(34, 'continue', 'Please, continue'),
(35, 'here', 'here'),
(36, 'bad_category', 'Selected category is bad.'),
(37, 'bad_dependence', 'Bad record in dependence.'),
(38, 'record_approved', 'Record is approved.'),
(39, 'record_not_approved', 'Record is not approved.'),
(40, 'error_approving', 'Get an error during approving.'),
(41, 'record_active', 'Record is active.'),
(42, 'record_not_active', 'Record is not active.'),
(43, 'error_activation', 'Get an error during activation.'),
(44, 'error_deactivation', 'Get an error during deactivation.'),
(45, 'filled_version', 'Field Version must be filled.'),
(46, 'filled_acceptance_criteria', 'Field Acceptance Criteria must be filled.'),
(47, 'filled_comments', 'Field Comments must be filled.'),
(48, 'not_correct', 'is not correct.'),
(49, 'field', 'Field'),
(50, 'created', 'Created'),
(51, 'to', 'To'),
(52, 'approved', 'Approved'),
(53, 'from', 'From'),
(54, 'existing_requirement', 'Selected Requirement is already connect with this Test'),
(57, 'no_approve_test', 'Impossible to make a Test Run. Record is not approved.'),
(58, 'terminated_test', 'Impossible to make a Test Run. Record is terminated.'),
(59, 'record_not_terminated', 'Record is not terminated.'),
(60, 'record_terminated', 'Record was terminated.'),
(61, 'edit_terminated', 'Impossible to edit this Test. Record is terminated.'),
(62, 'filled_setup', 'Field Setup must be filled.'),
(63, 'test_run_approved', 'Test Run was approved. Is possible to edit Result, Duration and Description.'),
(64, 'test_run_tested', 'Impossible to edit Test Run. Testing was ended.'),
(65, 'record_tested', 'Record was tested.'),
(66, 'record_not_tested', 'Record is not tested.'),
(67, 'terminate', 'Terminated'),
(68, 'tested', 'Tested'),
(69, 'bad_requirements', 'Bad record in requirements.'),
(70, 'no_upload', 'Get an error during saving file.'),
(71, 'no_file', 'You did not chose a file.'),
(72, 'same_file', 'This name of file is already in database. Choose another.'),
(73, 'no_approve_requirement', 'Impossible to make a Test. Record is not approved.'),
(74, 'no_active_requirement', 'Impossible to make a Test. Record is not active.'),
(75, 'bad_states', 'Bad record in states.'),
(76, 'bad_priorities', 'Bad record in priorities.'),
(77, 'bad_option', 'Selected option is bad');
