Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

create_database.sql 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.1.3
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Client : localhost:3306
  6. -- Généré le : Jeu 11 Décembre 2014 à 18:23
  7. -- Version du serveur : 5.1.73-1
  8. -- Version de PHP : 5.3.3-7+squeeze19
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET time_zone = "+00:00";
  11. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  12. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  13. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  14. /*!40101 SET NAMES utf8 */;
  15. --
  16. -- Base de données : `api.vdm`
  17. --
  18. -- --------------------------------------------------------
  19. --
  20. -- Structure de la table `api_keys`
  21. --
  22. CREATE TABLE IF NOT EXISTS `api_keys` (
  23. `id` int(11) NOT NULL AUTO_INCREMENT,
  24. `key` varchar(128) NOT NULL,
  25. PRIMARY KEY (`id`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  27. -- --------------------------------------------------------
  28. --
  29. -- Structure de la table `confirms`
  30. --
  31. CREATE TABLE IF NOT EXISTS `confirms` (
  32. `id` int(11) NOT NULL AUTO_INCREMENT,
  33. `confirmation` tinyint(1) NOT NULL,
  34. `status` int(11) NOT NULL,
  35. `user` int(11) NOT NULL,
  36. PRIMARY KEY (`id`),
  37. KEY `status` (`status`,`user`),
  38. KEY `user` (`user`)
  39. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  40. -- --------------------------------------------------------
  41. --
  42. -- Structure de la table `status`
  43. --
  44. CREATE TABLE IF NOT EXISTS `status` (
  45. `id` int(11) NOT NULL AUTO_INCREMENT,
  46. `status` longtext NOT NULL,
  47. `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  48. `user` int(11) NOT NULL,
  49. `longitude` float DEFAULT NULL,
  50. `latitude` float DEFAULT NULL,
  51. `media` varchar(256) DEFAULT NULL,
  52. PRIMARY KEY (`id`),
  53. KEY `user` (`user`)
  54. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  55. -- --------------------------------------------------------
  56. --
  57. -- Structure de la table `tokens`
  58. --
  59. CREATE TABLE IF NOT EXISTS `tokens` (
  60. `id` int(11) NOT NULL AUTO_INCREMENT,
  61. `token` varchar(128) NOT NULL,
  62. `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  63. `user` int(11) NOT NULL,
  64. PRIMARY KEY (`id`),
  65. KEY `user` (`user`)
  66. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  67. -- --------------------------------------------------------
  68. --
  69. -- Structure de la table `users`
  70. --
  71. CREATE TABLE IF NOT EXISTS `users` (
  72. `id` int(11) NOT NULL AUTO_INCREMENT,
  73. `username` varchar(255) NOT NULL,
  74. `password` varchar(128) NOT NULL,
  75. PRIMARY KEY (`id`)
  76. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  77. --
  78. -- Contraintes pour les tables exportées
  79. --
  80. --
  81. -- Contraintes pour la table `confirms`
  82. --
  83. ALTER TABLE `confirms`
  84. ADD CONSTRAINT `confirm_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`),
  85. ADD CONSTRAINT `confirm_status_id` FOREIGN KEY (`status`) REFERENCES `status` (`id`);
  86. --
  87. -- Contraintes pour la table `status`
  88. --
  89. ALTER TABLE `status`
  90. ADD CONSTRAINT `status_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`);
  91. --
  92. -- Contraintes pour la table `tokens`
  93. --
  94. ALTER TABLE `tokens`
  95. ADD CONSTRAINT `token_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`);
  96. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  97. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  98. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;