SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `task` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`project_id` int(9) NOT NULL,
`author_user_id` int(9) NOT NULL,
`performer_user_id` int(9) NOT NULL,
`create_data` date NOT NULL,
`status` int(9) NOT NULL,
`message` text NOT NULL,
`description` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
CREATE TABLE IF NOT EXISTS `task_status` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
CREATE TABLE IF NOT EXISTS `user` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`password` varchar(255) NOT NULL COMMENT 'md5(email + md5(password))',
`email` varchar(255) NOT NULL,
`level` int(11) NOT NULL COMMENT 'Уровень доступа',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Пользователи системы' AUTO_INCREMENT=7 ;
CREATE TABLE IF NOT EXISTS `user_profile` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`user_id` int(9) NOT NULL,
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`adress` varchar(255) NOT NULL,
`map` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;