-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathschema.sql
More file actions
137 lines (107 loc) · 3.15 KB
/
schema.sql
File metadata and controls
137 lines (107 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
-- phpMyAdmin SQL Dump
-- version 3.3.7deb3build0.10.10.1
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mer 12 Janvier 2011 à 16:46
-- Version du serveur: 5.1.49
-- Version de PHP: 5.3.3-1ubuntu9.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de données: `oauthProvider`
--
-- --------------------------------------------------------
--
-- Structure de la table `consumer`
--
CREATE TABLE IF NOT EXISTS `consumer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`consumer_key` varchar(255) NOT NULL,
`consumer_secret` varchar(255) NOT NULL,
`active` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
--
-- Contenu de la table `consumer`
--
INSERT INTO `consumer` (`id`, `consumer_key`, `consumer_secret`, `active`) VALUES
(1, 'key', 'secret', 1);
-- --------------------------------------------------------
--
-- Structure de la table `consumer_nonce`
--
CREATE TABLE IF NOT EXISTS `consumer_nonce` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`consumer_id` int(11) NOT NULL,
`timestamp` bigint(20) NOT NULL,
`nonce` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `consumer_id` (`consumer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Contenu de la table `consumer_nonce`
--
-- --------------------------------------------------------
--
-- Structure de la table `token`
--
CREATE TABLE IF NOT EXISTS `token` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` int(11) NOT NULL,
`consumer_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`token` varchar(255) NOT NULL,
`token_secret` varchar(255) NOT NULL,
`callback_url` text NOT NULL,
`verifier` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `consumer_id` (`consumer_id`),
KEY `user_id` (`user_id`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Contenu de la table `token`
--
-- --------------------------------------------------------
--
-- Structure de la table `token_type`
--
CREATE TABLE IF NOT EXISTS `token_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `token_type`
--
INSERT INTO `token_type` (`id`, `type`) VALUES
(1, 'request'),
(2, 'access');
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `user`
--
INSERT INTO `user` (`id`, `login`) VALUES
(1, 'test');
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `consumer_nonce`
--
ALTER TABLE `consumer_nonce`
ADD CONSTRAINT `consumer_nonce_ibfk_1` FOREIGN KEY (`consumer_id`) REFERENCES `consumer` (`id`) ON DELETE CASCADE;
--
-- Contraintes pour la table `token`
--
ALTER TABLE `token`
ADD CONSTRAINT `token_ibfk_2` FOREIGN KEY (`type`) REFERENCES `token_type` (`id`),
ADD CONSTRAINT `token_ibfk_1` FOREIGN KEY (`consumer_id`) REFERENCES `consumer` (`id`) ON DELETE CASCADE;