projects.sql 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. -- --------------------------------------------------------
  2. --
  3. -- Table structure for table `projects`
  4. --
  5. -- Creation: Aug 20, 2015 at 12:10 AM
  6. --
  7. DROP TABLE IF EXISTS `projects`;
  8. CREATE TABLE IF NOT EXISTS `projects` (
  9. `id` int(10) NOT NULL,
  10. `p_id` int(10) NULL,
  11. `s_id` int(10) NOT NULL,
  12. `u_id` int(10) NOT NULL,
  13. `name` varchar(50) COLLATE utf8_bin NOT NULL,
  14. `description` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  15. `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  16. `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  18. --
  19. -- RELATIONS FOR TABLE `projects`:
  20. -- `u_id`
  21. -- `users` -> `id`
  22. -- `p_id`
  23. -- `projects` -> `id`
  24. -- `s_id`
  25. -- `statuses` -> `id`
  26. --
  27. --
  28. -- Indexes for table `projects`
  29. --
  30. ALTER TABLE `projects`
  31. ADD PRIMARY KEY (`id`),
  32. ADD UNIQUE KEY `name` (`name`),
  33. ADD KEY `u_id` (`u_id`),
  34. ADD KEY `p_id` (`p_id`),
  35. ADD KEY `s_id` (`s_id`);
  36. --
  37. -- AUTO_INCREMENT for table `projects`
  38. --
  39. ALTER TABLE `projects`
  40. MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;