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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

blog_mysql.sql 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. -- Adminer 4.2.4 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) NOT NULL,
  10. `icon` blob,
  11. PRIMARY KEY (`id`)
  12. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  13. INSERT INTO `categories` (`name`, `icon`) VALUES
  14. ('announcement', NULL),
  15. ('article', NULL);
  16. DROP TABLE IF EXISTS `comments`;
  17. CREATE TABLE `comments` (
  18. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  19. `post_id` int(11) NOT NULL,
  20. `message` varchar(255) NOT NULL,
  21. PRIMARY KEY (`id`),
  22. KEY `post_id` (`post_id`),
  23. CONSTRAINT `comments_post_id_fkey` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  25. INSERT INTO `comments` (`post_id`, `message`) VALUES
  26. (1, 'great'),
  27. (1, 'fantastic'),
  28. (2, 'thank you'),
  29. (2, 'awesome');
  30. DROP TABLE IF EXISTS `posts`;
  31. CREATE TABLE `posts` (
  32. `id` int(11) NOT NULL AUTO_INCREMENT,
  33. `user_id` int(11) NOT NULL,
  34. `category_id` int(11) NOT NULL,
  35. `content` varchar(255) NOT NULL,
  36. PRIMARY KEY (`id`),
  37. KEY `category_id` (`category_id`),
  38. KEY `user_id` (`user_id`),
  39. CONSTRAINT `posts_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  40. CONSTRAINT `posts_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
  41. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  42. INSERT INTO `posts` (`user_id`, `category_id`, `content`) VALUES
  43. (1, 1, 'blog started'),
  44. (1, 2, 'It works!');
  45. DROP TABLE IF EXISTS `post_tags`;
  46. CREATE TABLE `post_tags` (
  47. `id` int(11) NOT NULL AUTO_INCREMENT,
  48. `post_id` int(11) NOT NULL,
  49. `tag_id` int(11) NOT NULL,
  50. PRIMARY KEY (`id`),
  51. KEY `post_id` (`post_id`),
  52. KEY `tag_id` (`tag_id`),
  53. CONSTRAINT `post_tags_post_id_fkey` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`),
  54. CONSTRAINT `post_tags_tag_id_fkey` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`)
  55. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  56. INSERT INTO `post_tags` (`post_id`, `tag_id`) VALUES
  57. (1, 1),
  58. (1, 2),
  59. (2, 1),
  60. (2, 2);
  61. DROP TABLE IF EXISTS `tags`;
  62. CREATE TABLE `tags` (
  63. `id` int(11) NOT NULL AUTO_INCREMENT,
  64. `name` varchar(255) NOT NULL,
  65. `is_important` bit(1) NOT NULL,
  66. PRIMARY KEY (`id`)
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  68. INSERT INTO `tags` (`name`, `is_important`) VALUES
  69. ('funny', 0),
  70. ('important', 1);
  71. DROP TABLE IF EXISTS `users`;
  72. CREATE TABLE `users` (
  73. `id` int(11) NOT NULL AUTO_INCREMENT,
  74. `username` varchar(255) NOT NULL,
  75. `password` varchar(255) NOT NULL,
  76. `location` point,
  77. PRIMARY KEY (`id`)
  78. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  79. INSERT INTO `users` (`username`, `password`, `location`) VALUES
  80. ('user1', 'pass1', NULL),
  81. ('user2', 'pass2', NULL);
  82. DROP TABLE IF EXISTS `countries`;
  83. CREATE TABLE `countries` (
  84. `id` int(11) NOT NULL AUTO_INCREMENT,
  85. `name` varchar(255) NOT NULL,
  86. `shape` polygon NOT NULL,
  87. PRIMARY KEY (`id`)
  88. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  89. INSERT INTO `countries` (`name`, `shape`) VALUES
  90. ('Left', ST_GeomFromText('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))')),
  91. ('Right', ST_GeomFromText('POLYGON ((70 10, 80 40, 60 40, 50 20, 70 10))'));
  92. DROP TABLE IF EXISTS `events`;
  93. CREATE TABLE `events` (
  94. `id` int(11) NOT NULL AUTO_INCREMENT,
  95. `name` varchar(255) NOT NULL,
  96. `datetime` datetime,
  97. `visitors` bigint(20),
  98. PRIMARY KEY (`id`)
  99. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  100. INSERT INTO `events` (`name`, `datetime`, `visitors`) VALUES
  101. ('Launch', '2016-01-01 13:01:01', 0);
  102. DROP VIEW IF EXISTS `tag_usage`;
  103. CREATE VIEW `tag_usage` AS select `name`, count(`name`) AS `count` from `tags`, `post_tags` where `tags`.`id` = `post_tags`.`tag_id` group by `name` order by `count` desc, `name`;
  104. DROP TABLE IF EXISTS `products`;
  105. CREATE TABLE `products` (
  106. `id` int(11) NOT NULL AUTO_INCREMENT,
  107. `name` varchar(255) NOT NULL,
  108. `price` decimal(10,2) NOT NULL,
  109. `properties` longtext NOT NULL,
  110. `created_at` datetime NOT NULL,
  111. `deleted_at` datetime,
  112. PRIMARY KEY (`id`)
  113. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  114. INSERT INTO `products` (`name`, `price`, `properties`, `created_at`) VALUES
  115. ('Calculator', '23.01', '{"depth":false,"model":"TRX-120","width":100,"height":null}', '1970-01-01 01:01:01');
  116. DROP TABLE IF EXISTS `barcodes2`;
  117. DROP TABLE IF EXISTS `barcodes`;
  118. CREATE TABLE `barcodes` (
  119. `id` int(11) NOT NULL AUTO_INCREMENT,
  120. `product_id` int(11) NOT NULL,
  121. `hex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  122. `bin` blob NOT NULL,
  123. PRIMARY KEY (`id`),
  124. CONSTRAINT `barcodes_product_id_fkey` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
  125. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  126. INSERT INTO `barcodes` (`product_id`, `hex`, `bin`) VALUES
  127. (1, '00ff01', UNHEX('00ff01'));
  128. DROP TABLE IF EXISTS `kunsthåndværk`;
  129. CREATE TABLE `kunsthåndværk` (
  130. `id` varchar(36) NOT NULL,
  131. `Umlauts ä_ö_ü-COUNT` int(11) NOT NULL,
  132. `user_id` int(11) NOT NULL,
  133. `invisible` varchar(36),
  134. PRIMARY KEY (`id`),
  135. CONSTRAINT `kunsthåndværk_Umlauts ä_ö_ü-COUNT_fkey` UNIQUE (`Umlauts ä_ö_ü-COUNT`),
  136. CONSTRAINT `kunsthåndværk_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
  137. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  138. INSERT INTO `kunsthåndværk` (`id`, `Umlauts ä_ö_ü-COUNT`, `user_id`, `invisible`) VALUES
  139. ('e42c77c6-06a4-4502-816c-d112c7142e6d', 1, 1, NULL),
  140. ('e31ecfe6-591f-4660-9fbd-1a232083037f', 2, 2, NULL);
  141. DROP TABLE IF EXISTS `invisibles`;
  142. CREATE TABLE `invisibles` (
  143. `id` varchar(36) NOT NULL,
  144. PRIMARY KEY (`id`)
  145. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  146. INSERT INTO `invisibles` (`id`) VALUES
  147. ('e42c77c6-06a4-4502-816c-d112c7142e6d');
  148. DROP TABLE IF EXISTS `nopk`;
  149. CREATE TABLE `nopk` (
  150. `id` varchar(36) NOT NULL
  151. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  152. INSERT INTO `nopk` (`id`) VALUES
  153. ('e42c77c6-06a4-4502-816c-d112c7142e6d');
  154. SET foreign_key_checks = 1;
  155. -- 2016-11-05 13:11:47