Browse Source

database structure

master
Robin Thoni 10 years ago
parent
commit
f70fab5c82
1 changed files with 122 additions and 0 deletions
  1. 122
    0
      misc/create_database.sql

+ 122
- 0
misc/create_database.sql View File

@@ -0,0 +1,122 @@
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
+
10
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11
+SET time_zone = "+00:00";
12
+
13
+
14
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17
+/*!40101 SET NAMES utf8 */;
18
+
19
+--
20
+-- Base de données :  `api.vdm`
21
+--
22
+
23
+-- --------------------------------------------------------
24
+
25
+--
26
+-- Structure de la table `api_keys`
27
+--
28
+
29
+CREATE TABLE IF NOT EXISTS `api_keys` (
30
+  `id` int(11) NOT NULL AUTO_INCREMENT,
31
+  `key` varchar(128) NOT NULL,
32
+  PRIMARY KEY (`id`)
33
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
34
+
35
+-- --------------------------------------------------------
36
+
37
+--
38
+-- Structure de la table `confirms`
39
+--
40
+
41
+CREATE TABLE IF NOT EXISTS `confirms` (
42
+  `id` int(11) NOT NULL AUTO_INCREMENT,
43
+  `confirmation` tinyint(1) NOT NULL,
44
+  `status` int(11) NOT NULL,
45
+  `user` int(11) NOT NULL,
46
+  PRIMARY KEY (`id`),
47
+  KEY `status` (`status`,`user`),
48
+  KEY `user` (`user`)
49
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
50
+
51
+-- --------------------------------------------------------
52
+
53
+--
54
+-- Structure de la table `status`
55
+--
56
+
57
+CREATE TABLE IF NOT EXISTS `status` (
58
+  `id` int(11) NOT NULL AUTO_INCREMENT,
59
+  `status` longtext NOT NULL,
60
+  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
61
+  `user` int(11) NOT NULL,
62
+  `longitude` float DEFAULT NULL,
63
+  `latitude` float DEFAULT NULL,
64
+  `media` varchar(256) DEFAULT NULL,
65
+  PRIMARY KEY (`id`),
66
+  KEY `user` (`user`)
67
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
68
+
69
+-- --------------------------------------------------------
70
+
71
+--
72
+-- Structure de la table `tokens`
73
+--
74
+
75
+CREATE TABLE IF NOT EXISTS `tokens` (
76
+  `id` int(11) NOT NULL AUTO_INCREMENT,
77
+  `token` varchar(128) NOT NULL,
78
+  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
79
+  `user` int(11) NOT NULL,
80
+  PRIMARY KEY (`id`),
81
+  KEY `user` (`user`)
82
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
83
+
84
+-- --------------------------------------------------------
85
+
86
+--
87
+-- Structure de la table `users`
88
+--
89
+
90
+CREATE TABLE IF NOT EXISTS `users` (
91
+  `id` int(11) NOT NULL AUTO_INCREMENT,
92
+  `username` varchar(255) NOT NULL,
93
+  `password` varchar(128) NOT NULL,
94
+  PRIMARY KEY (`id`)
95
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
96
+
97
+--
98
+-- Contraintes pour les tables exportées
99
+--
100
+
101
+--
102
+-- Contraintes pour la table `confirms`
103
+--
104
+ALTER TABLE `confirms`
105
+  ADD CONSTRAINT `confirm_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`),
106
+  ADD CONSTRAINT `confirm_status_id` FOREIGN KEY (`status`) REFERENCES `status` (`id`);
107
+
108
+--
109
+-- Contraintes pour la table `status`
110
+--
111
+ALTER TABLE `status`
112
+  ADD CONSTRAINT `status_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`);
113
+
114
+--
115
+-- Contraintes pour la table `tokens`
116
+--
117
+ALTER TABLE `tokens`
118
+  ADD CONSTRAINT `token_user_id` FOREIGN KEY (`user`) REFERENCES `users` (`id`);
119
+
120
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
121
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
122
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Loading…
Cancel
Save