api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

blog.sql 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. -- Adminer 4.1.0 MySQL dump
  2. SET NAMES utf8;
  3. SET time_zone = '+00:00';
  4. SET foreign_key_checks = 0;
  5. SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
  6. DROP TABLE IF EXISTS `categories`;
  7. CREATE TABLE `categories` (
  8. `id` int(11) NOT NULL AUTO_INCREMENT,
  9. `name` varchar(255) COLLATE utf8_bin NOT NULL,
  10. PRIMARY KEY (`id`)
  11. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  12. INSERT INTO `categories` (`id`, `name`) VALUES
  13. (1, 'anouncement'),
  14. (2, 'article');
  15. DROP TABLE IF EXISTS `comments`;
  16. CREATE TABLE `comments` (
  17. `id` int(11) NOT NULL AUTO_INCREMENT,
  18. `post_id` int(11) NOT NULL,
  19. `message` varchar(255) COLLATE utf8_bin NOT NULL,
  20. PRIMARY KEY (`id`),
  21. KEY `post_id` (`post_id`),
  22. CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)
  23. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  24. INSERT INTO `comments` (`id`, `post_id`, `message`) VALUES
  25. (1, 1, 'great'),
  26. (2, 1, 'fantastic'),
  27. (3, 2, 'thank you'),
  28. (4, 2, 'awesome');
  29. DROP TABLE IF EXISTS `posts`;
  30. CREATE TABLE `posts` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT,
  32. `user_id` int(11) NOT NULL,
  33. `category_id` int(11) NOT NULL,
  34. `content` varchar(255) COLLATE utf8_bin NOT NULL,
  35. PRIMARY KEY (`id`),
  36. KEY `category_id` (`category_id`),
  37. KEY `user_id` (`user_id`),
  38. CONSTRAINT `posts_ibfk_3` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  39. CONSTRAINT `posts_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
  40. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  41. INSERT INTO `posts` (`id`, `user_id`, `category_id`, `content`) VALUES
  42. (1, 1, 1, 'blog started'),
  43. (2, 1, 2, 'It works!');
  44. DROP TABLE IF EXISTS `post_tags`;
  45. CREATE TABLE `post_tags` (
  46. `id` int(11) NOT NULL AUTO_INCREMENT,
  47. `post_id` int(11) NOT NULL,
  48. `tag_id` int(11) NOT NULL,
  49. PRIMARY KEY (`id`),
  50. KEY `post_id` (`post_id`),
  51. KEY `tag_id` (`tag_id`),
  52. CONSTRAINT `post_tags_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`),
  53. CONSTRAINT `post_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`)
  54. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  55. INSERT INTO `post_tags` (`id`, `post_id`, `tag_id`) VALUES
  56. (1, 1, 1),
  57. (2, 1, 2),
  58. (3, 2, 1),
  59. (4, 2, 2);
  60. DROP TABLE IF EXISTS `tags`;
  61. CREATE TABLE `tags` (
  62. `id` int(11) NOT NULL AUTO_INCREMENT,
  63. `name` varchar(255) COLLATE utf8_bin NOT NULL,
  64. PRIMARY KEY (`id`)
  65. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  66. INSERT INTO `tags` (`id`, `name`) VALUES
  67. (1, 'funny'),
  68. (2, 'important');
  69. DROP TABLE IF EXISTS `users`;
  70. CREATE TABLE `users` (
  71. `id` int(11) NOT NULL AUTO_INCREMENT,
  72. `username` varchar(255) COLLATE utf8_bin NOT NULL,
  73. `password` varchar(255) COLLATE utf8_bin NOT NULL,
  74. PRIMARY KEY (`id`)
  75. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  76. INSERT INTO `users` (`id`, `username`, `password`) VALUES
  77. (1, 'user1', 'pass1'),
  78. (2, 'user2', 'pass2');
  79. -- 2015-02-14 17:55:38