-- phpMyAdmin SQL Dump
-- version 2.9.2-rc1
-- http://www.phpmyadmin.net
-- 
-- Počítač: localhost
-- Verze MySQL: 5.0.60
-- Verze PHP: 5.2.12-pl0-gentoo
-- 
-- 

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

-- 
-- Struktura tabulky `iso_categoryies`
-- 

CREATE TABLE `iso_categoryies` (
  `id_category` int(11) NOT NULL auto_increment,
  `id_parent` int(11) NOT NULL default '0',
  `position` int(11) NOT NULL default '1',
  `category_name` varchar(200) character set utf8 collate utf8_czech_ci NOT NULL,
  `category_active` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id_category`),
  KEY `id_parent` (`id_parent`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_documents`
-- 

CREATE TABLE `iso_documents` (
  `id_document` int(11) NOT NULL auto_increment,
  `id_category` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `doc_name` varchar(500) collate utf8_czech_ci NOT NULL,
  `doc_created` datetime NOT NULL,
  `doc_active` tinyint(1) NOT NULL default '0',
  `doc_note` text collate utf8_czech_ci,
  PRIMARY KEY  (`id_document`),
  KEY `id_category` (`id_category`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_errors`
-- 

CREATE TABLE `iso_errors` (
  `id_error` int(11) NOT NULL auto_increment,
  `datetime` datetime NOT NULL,
  `uri` varchar(500) collate utf8_czech_ci default NULL,
  `referer` varchar(500) collate utf8_czech_ci default NULL,
  `message` varchar(500) collate utf8_czech_ci default NULL,
  `stack_trace` text collate utf8_czech_ci,
  `params` text character set cp1250 collate cp1250_czech_cs,
  PRIMARY KEY  (`id_error`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_groups`
-- 

CREATE TABLE `iso_groups` (
  `id_group` int(11) NOT NULL auto_increment,
  `group_name` varchar(100) character set utf8 collate utf8_czech_ci NOT NULL,
  `group_active` tinyint(1) NOT NULL default '0',
  `group_note` text character set utf8 collate utf8_czech_ci,
  PRIMARY KEY  (`id_group`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_history`
-- 

CREATE TABLE `iso_history` (
  `id_history` int(11) NOT NULL auto_increment,
  `id_document` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `history_action` varchar(20) collate utf8_czech_ci NOT NULL,
  `history_added` datetime NOT NULL,
  PRIMARY KEY  (`id_history`),
  KEY `id_document` (`id_document`,`id_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_messages`
-- 

CREATE TABLE `iso_messages` (
  `id_message` int(11) NOT NULL auto_increment,
  `id_sender` int(11) NOT NULL,
  `id_reciever` int(11) NOT NULL,
  `datetime` datetime NOT NULL,
  `subject` varchar(100) collate utf8_czech_ci NOT NULL,
  `body` text collate utf8_czech_ci NOT NULL,
  `is_read` tinyint(1) NOT NULL default '0',
  `is_bin` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id_message`),
  KEY `id_sender` (`id_sender`,`id_reciever`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_revision_confirm`
-- 

CREATE TABLE `iso_revision_confirm` (
  `id_revision_confirm` int(11) NOT NULL auto_increment,
  `id_user` int(11) NOT NULL,
  `id_revision` int(11) NOT NULL,
  `revision_confirm_added` datetime NOT NULL,
  `revision_confirm_confirmed` datetime default NULL,
  PRIMARY KEY  (`id_revision_confirm`),
  KEY `id_user` (`id_user`,`id_revision`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_revisions`
-- 

CREATE TABLE `iso_revisions` (
  `id_revision` int(11) NOT NULL auto_increment,
  `id_version` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_user_created` int(11) NOT NULL,
  `id_user_checked` int(11) NOT NULL,
  `id_user_approved` int(11) NOT NULL,
  `rev_number` int(11) NOT NULL,
  `rev_file` varchar(100) character set utf8 collate utf8_czech_ci NOT NULL,
  `rev_filename` varchar(500) character set utf8 collate utf8_czech_ci NOT NULL,
  `rev_added` datetime NOT NULL,
  `rev_note` text character set utf8 collate utf8_czech_ci,
  PRIMARY KEY  (`id_revision`),
  KEY `id_version` (`id_version`),
  KEY `id_user` (`id_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_rights_group_category`
-- 

CREATE TABLE `iso_rights_group_category` (
  `id_rights` int(11) NOT NULL auto_increment,
  `id_group` int(11) NOT NULL,
  `id_category` int(11) NOT NULL,
  `rights_active` tinyint(1) NOT NULL default '0',
  `read` tinyint(1) NOT NULL default '0',
  `add` tinyint(1) NOT NULL default '0',
  `edit` tinyint(1) NOT NULL default '0',
  `del` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id_rights`),
  KEY `id_group` (`id_group`,`id_category`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_settings`
-- 

CREATE TABLE `iso_settings` (
  `id_settings` int(11) NOT NULL auto_increment,
  `key` varchar(40) character set utf8 collate utf8_czech_ci NOT NULL,
  `input_type` varchar(20) character set utf8 collate utf8_czech_ci NOT NULL,
  `position` int(11) NOT NULL,
  `value_int` int(11) default NULL,
  `value_decimal` decimal(8,3) default NULL,
  `value_string` varchar(300) character set utf8 collate utf8_czech_ci default NULL,
  `note` varchar(40) character set utf8 collate utf8_czech_ci default NULL,
  PRIMARY KEY  (`id_settings`),
  UNIQUE KEY `key` (`key`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_user_group`
-- 

CREATE TABLE `iso_user_group` (
  `id_group` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`id_group`,`id_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

-- 
-- Struktura tabulky `iso_users`
-- 

CREATE TABLE `iso_users` (
  `id_user` int(11) NOT NULL auto_increment,
  `login` varchar(50) collate utf8_czech_ci NOT NULL,
  `password` varchar(40) collate utf8_czech_ci NOT NULL,
  `email` varchar(200) collate utf8_czech_ci NOT NULL,
  `user_firstname` varchar(80) collate utf8_czech_ci default NULL,
  `user_surname` varchar(100) collate utf8_czech_ci default NULL,
  `user_active` tinyint(1) NOT NULL default '0',
  `user_active_request` tinyint(1) NOT NULL default '0',
  `super_admin` tinyint(1) NOT NULL default '0',
  `send_mail` tinyint(1) NOT NULL default '0',
  `week_start` tinyint(4) NOT NULL default '1',
  `lang` varchar(2) collate utf8_czech_ci NOT NULL,
  PRIMARY KEY  (`id_user`),
  UNIQUE KEY `login` (`login`,`email`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_version_confirm`
-- 

CREATE TABLE `iso_version_confirm` (
  `id_version_confirm` int(11) NOT NULL auto_increment,
  `id_user` int(11) NOT NULL,
  `id_version` int(11) NOT NULL,
  `version_confirm_added` datetime NOT NULL,
  `version_confirm_confirmed` datetime default NULL,
  PRIMARY KEY  (`id_version_confirm`),
  KEY `id_user` (`id_user`,`id_version`),
  KEY `version_confirm_datetime` (`version_confirm_confirmed`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

-- 
-- Struktura tabulky `iso_versions`
-- 

CREATE TABLE `iso_versions` (
  `id_version` int(11) NOT NULL auto_increment,
  `id_document` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_user_created` int(11) NOT NULL,
  `id_user_checked` int(11) NOT NULL,
  `id_user_approved` int(11) NOT NULL,
  `ver_number` int(11) NOT NULL,
  `ver_file` varchar(100) character set utf8 collate utf8_czech_ci NOT NULL,
  `ver_filename` varchar(500) character set utf8 collate utf8_czech_ci NOT NULL,
  `ver_added` datetime NOT NULL,
  `ver_expiration` datetime NULL,
  `ver_note` text character set utf8 collate utf8_czech_ci,
  PRIMARY KEY  (`id_version`),
  KEY `id_document` (`id_document`),
  KEY `id_user` (`id_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
