|
@@ -3,7 +3,7 @@
|
|
|
-- http://www.phpmyadmin.net
|
|
|
--
|
|
|
-- Host: 127.0.0.1
|
|
|
--- Generation Time: Aug 20, 2015 at 02:07 AM
|
|
|
+-- Generation Time: Aug 21, 2015 at 01:47 AM
|
|
|
-- Server version: 5.6.25
|
|
|
-- PHP Version: 5.6.11
|
|
|
|
|
@@ -15,7 +15,7 @@ SET time_zone = "+00:00";
|
|
|
--
|
|
|
-- Database: `bugs`
|
|
|
--
|
|
|
-CREATE DATABASE IF NOT EXISTS `bugs` DEFAULT CHARSET=utf8 COLLATE utf8_bin;
|
|
|
+CREATE DATABASE IF NOT EXISTS `bugs` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
|
|
|
USE `bugs`;
|
|
|
|
|
|
-- --------------------------------------------------------
|
|
@@ -23,47 +23,38 @@ USE `bugs`;
|
|
|
--
|
|
|
-- Table structure for table `actions`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:21 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:04 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `actions`;
|
|
|
CREATE TABLE IF NOT EXISTS `actions` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
|
-- RELATIONS FOR TABLE `actions`:
|
|
|
--
|
|
|
|
|
|
---
|
|
|
--- Dumping data for table `actions`
|
|
|
---
|
|
|
-
|
|
|
-INSERT INTO `actions` (`id`, `name`) VALUES
|
|
|
-(1, 'view_profile');
|
|
|
-
|
|
|
-- --------------------------------------------------------
|
|
|
|
|
|
--
|
|
|
-- Table structure for table `activities`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 09:14 PM
|
|
|
+-- Creation: Aug 20, 2015 at 11:20 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `activities`;
|
|
|
CREATE TABLE IF NOT EXISTS `activities` (
|
|
|
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
`a_id` int(10) NOT NULL,
|
|
|
- `description` varchar(100) DEFAULT NULL
|
|
|
+ `description` varchar(100) COLLATE utf8_bin DEFAULT NULL
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
|
-- RELATIONS FOR TABLE `activities`:
|
|
|
-- `a_id`
|
|
|
-- `actions` -> `id`
|
|
|
--- `a_id`
|
|
|
--- `actions` -> `id`
|
|
|
--
|
|
|
|
|
|
-- --------------------------------------------------------
|
|
@@ -71,15 +62,15 @@ CREATE TABLE IF NOT EXISTS `activities` (
|
|
|
--
|
|
|
-- Table structure for table `emails`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 09:14 PM
|
|
|
+-- Creation: Aug 20, 2015 at 11:30 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `emails`;
|
|
|
CREATE TABLE IF NOT EXISTS `emails` (
|
|
|
`u_id` int(10) NOT NULL,
|
|
|
- `subject` varchar(77) NOT NULL,
|
|
|
- `body` text NOT NULL,
|
|
|
- `date` date NOT NULL
|
|
|
+ `subject` varchar(77) COLLATE utf8_bin NOT NULL,
|
|
|
+ `body` text COLLATE utf8_bin NOT NULL,
|
|
|
+ `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
@@ -91,7 +82,7 @@ CREATE TABLE IF NOT EXISTS `emails` (
|
|
|
--
|
|
|
-- Table structure for table `issues`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 09:14 PM
|
|
|
+-- Creation: Aug 20, 2015 at 12:10 AM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `issues`;
|
|
@@ -101,8 +92,8 @@ CREATE TABLE IF NOT EXISTS `issues` (
|
|
|
`u_id` int(10) DEFAULT NULL,
|
|
|
`pr_id` int(10) NOT NULL,
|
|
|
`s_id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL,
|
|
|
- `description` varchar(100) NOT NULL,
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL,
|
|
|
+ `description` varchar(100) COLLATE utf8_bin NOT NULL,
|
|
|
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
`date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
@@ -111,14 +102,6 @@ CREATE TABLE IF NOT EXISTS `issues` (
|
|
|
-- RELATIONS FOR TABLE `issues`:
|
|
|
-- `p_id`
|
|
|
-- `projects` -> `id`
|
|
|
--- `pr_id`
|
|
|
--- `priorities` -> `id`
|
|
|
--- `s_id`
|
|
|
--- `statuses` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
--- `p_id`
|
|
|
--- `projects` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `pr_id`
|
|
@@ -148,13 +131,13 @@ DELIMITER ;
|
|
|
--
|
|
|
-- Table structure for table `issue_roles`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:19 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `issue_roles`;
|
|
|
CREATE TABLE IF NOT EXISTS `issue_roles` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
@@ -166,7 +149,7 @@ CREATE TABLE IF NOT EXISTS `issue_roles` (
|
|
|
--
|
|
|
-- Table structure for table `messages`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:19 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `messages`;
|
|
@@ -175,20 +158,14 @@ CREATE TABLE IF NOT EXISTS `messages` (
|
|
|
`u_id` int(10) NOT NULL,
|
|
|
`i_id` int(10) DEFAULT NULL,
|
|
|
`p_id` int(10) DEFAULT NULL,
|
|
|
- `subject` varchar(50) NOT NULL,
|
|
|
- `message` text NOT NULL,
|
|
|
+ `subject` varchar(50) COLLATE utf8_bin NOT NULL,
|
|
|
+ `message` text COLLATE utf8_bin NOT NULL,
|
|
|
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
`date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
|
-- RELATIONS FOR TABLE `messages`:
|
|
|
--- `i_id`
|
|
|
--- `issues` -> `id`
|
|
|
--- `p_id`
|
|
|
--- `projects` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `i_id`
|
|
@@ -206,6 +183,7 @@ CREATE TRIGGER `message_insert` BEFORE INSERT ON `messages`
|
|
|
FOR EACH ROW IF new.i_id IS NOT NULL AND new.p_id IS NOT NULL THEN
|
|
|
SIGNAL SQLSTATE '45000'
|
|
|
SET MESSAGE_TEXT = 'Messages can only be related to one thing';
|
|
|
+
|
|
|
ELSE
|
|
|
SET new.date_modified = NOW();
|
|
|
END IF
|
|
@@ -228,13 +206,13 @@ DELIMITER ;
|
|
|
--
|
|
|
-- Table structure for table `priorities`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:19 PM
|
|
|
+-- Creation: Aug 20, 2015 at 12:10 AM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `priorities`;
|
|
|
CREATE TABLE IF NOT EXISTS `priorities` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
@@ -256,7 +234,7 @@ INSERT INTO `priorities` (`id`, `name`) VALUES
|
|
|
--
|
|
|
-- Table structure for table `projects`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 12:10 AM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `projects`;
|
|
@@ -265,20 +243,14 @@ CREATE TABLE IF NOT EXISTS `projects` (
|
|
|
`p_id` int(10) NOT NULL,
|
|
|
`s_id` int(10) NOT NULL,
|
|
|
`u_id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL,
|
|
|
- `description` varchar(100) DEFAULT NULL,
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL,
|
|
|
+ `description` varchar(100) COLLATE utf8_bin DEFAULT NULL,
|
|
|
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
`date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
|
-- RELATIONS FOR TABLE `projects`:
|
|
|
--- `p_id`
|
|
|
--- `projects` -> `id`
|
|
|
--- `s_id`
|
|
|
--- `statuses` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `p_id`
|
|
@@ -308,13 +280,13 @@ DELIMITER ;
|
|
|
--
|
|
|
-- Table structure for table `project_roles`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `project_roles`;
|
|
|
CREATE TABLE IF NOT EXISTS `project_roles` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(10) NOT NULL
|
|
|
+ `name` varchar(10) COLLATE utf8_bin NOT NULL
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
@@ -334,7 +306,7 @@ INSERT INTO `project_roles` (`id`, `name`) VALUES
|
|
|
--
|
|
|
-- Table structure for table `r_issue_user`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `r_issue_user`;
|
|
@@ -348,12 +320,6 @@ CREATE TABLE IF NOT EXISTS `r_issue_user` (
|
|
|
-- RELATIONS FOR TABLE `r_issue_user`:
|
|
|
-- `i_id`
|
|
|
-- `issues` -> `id`
|
|
|
--- `r_id`
|
|
|
--- `issue_roles` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
--- `i_id`
|
|
|
--- `issues` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `r_id`
|
|
@@ -365,7 +331,7 @@ CREATE TABLE IF NOT EXISTS `r_issue_user` (
|
|
|
--
|
|
|
-- Table structure for table `r_message_user`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `r_message_user`;
|
|
@@ -376,10 +342,6 @@ CREATE TABLE IF NOT EXISTS `r_message_user` (
|
|
|
|
|
|
--
|
|
|
-- RELATIONS FOR TABLE `r_message_user`:
|
|
|
--- `m_id`
|
|
|
--- `messages` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `m_id`
|
|
@@ -391,7 +353,7 @@ CREATE TABLE IF NOT EXISTS `r_message_user` (
|
|
|
--
|
|
|
-- Table structure for table `r_project_user`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 10:03 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `r_project_user`;
|
|
@@ -405,12 +367,6 @@ CREATE TABLE IF NOT EXISTS `r_project_user` (
|
|
|
-- RELATIONS FOR TABLE `r_project_user`:
|
|
|
-- `p_id`
|
|
|
-- `projects` -> `id`
|
|
|
--- `r_id`
|
|
|
--- `project_roles` -> `id`
|
|
|
--- `u_id`
|
|
|
--- `users` -> `id`
|
|
|
--- `p_id`
|
|
|
--- `projects` -> `id`
|
|
|
-- `u_id`
|
|
|
-- `users` -> `id`
|
|
|
-- `r_id`
|
|
@@ -422,13 +378,13 @@ CREATE TABLE IF NOT EXISTS `r_project_user` (
|
|
|
--
|
|
|
-- Table structure for table `statuses`
|
|
|
--
|
|
|
--- Creation: Aug 14, 2015 at 10:20 PM
|
|
|
+-- Creation: Aug 20, 2015 at 12:10 AM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `statuses`;
|
|
|
CREATE TABLE IF NOT EXISTS `statuses` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL,
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL,
|
|
|
`open` tinyint(1) NOT NULL DEFAULT '1'
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
@@ -452,18 +408,19 @@ INSERT INTO `statuses` (`id`, `name`, `open`) VALUES
|
|
|
--
|
|
|
-- Table structure for table `users`
|
|
|
--
|
|
|
--- Creation: Aug 20, 2015 at 12:06 AM
|
|
|
+-- Creation: Aug 20, 2015 at 10:05 PM
|
|
|
--
|
|
|
|
|
|
DROP TABLE IF EXISTS `users`;
|
|
|
CREATE TABLE IF NOT EXISTS `users` (
|
|
|
`id` int(10) NOT NULL,
|
|
|
- `name` varchar(50) NOT NULL,
|
|
|
- `email` varchar(254) NOT NULL,
|
|
|
+ `name` varchar(50) COLLATE utf8_bin NOT NULL,
|
|
|
+ `email` varchar(254) COLLATE utf8_bin NOT NULL,
|
|
|
`date_registered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
`date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
|
|
- `password` varchar(256) NOT NULL,
|
|
|
- `salt` varchar(256) NOT NULL
|
|
|
+ `password` varchar(256) COLLATE utf8_bin NOT NULL,
|
|
|
+ `salt` varchar(256) COLLATE utf8_bin NOT NULL,
|
|
|
+ `active` tinyint(1) NOT NULL DEFAULT '0'
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
|
|
--
|
|
@@ -509,7 +466,7 @@ ALTER TABLE `activities`
|
|
|
--
|
|
|
ALTER TABLE `emails`
|
|
|
ADD KEY `u_id` (`u_id`),
|
|
|
- ADD KEY `date` (`date`);
|
|
|
+ ADD KEY `date` (`date_created`);
|
|
|
|
|
|
--
|
|
|
-- Indexes for table `issues`
|