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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

blog_mysql.sql 6.3KB

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