-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.sql
151 lines (134 loc) · 4.94 KB
/
database.sql
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* Copyright 2008-2024 Anael MOBILIA
*
* This file is part of image-heberg.fr.
*
* image-heberg.fr is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* image-heberg.fr is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with image-heberg.fr. If not, see <http://www.gnu.org/licenses/>
*/
--
-- Structure de la table `images`
--
CREATE TABLE IF NOT EXISTS `images`
(
`id` int(20) NOT NULL AUTO_INCREMENT,
`remote_addr` varchar(45) NOT NULL,
`date_action` datetime NOT NULL,
`old_name` varchar(255) NOT NULL,
`new_name` varchar(30) NOT NULL,
`size` int(11) NOT NULL,
`height` int(11) NOT NULL,
`width` int(11) NOT NULL,
`last_view` date NOT NULL,
`nb_view_v4` int(11) NOT NULL,
`nb_view_v6` int(11) NOT NULL,
`md5` varchar(32) NOT NULL,
`isBloquee` tinyint(1) NOT NULL,
`isSignalee` tinyint(1) NOT NULL,
`isApprouvee` tinyint(1) NOT NULL,
`abuse_network` varchar(45) NOT NULL,
PRIMARY KEY (`id`),
KEY `statutImage` (`isBloquee`, `isApprouvee`, `isSignalee`) USING BTREE,
KEY `abuse_network_bloquee` (`abuse_network`,`isBloquee`) USING BTREE,
KEY `abuse_network_approuvee` (`abuse_network`,`isApprouvee`),
KEY `isApprouvee` (`isApprouvee`)
) ENGINE = MyISAM
DEFAULT CHARSET = utf8;
-- --------------------------------------------------------
--
-- Structure de la table `login`
--
CREATE TABLE IF NOT EXISTS `login`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`remote_addr` varchar(45) NOT NULL,
`date_action` datetime NOT NULL,
`membres_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `membres_id` (`membres_id`)
) ENGINE = MyISAM
DEFAULT CHARSET = utf8;
-- --------------------------------------------------------
--
-- Structure de la table `membres`
--
CREATE TABLE IF NOT EXISTS `membres`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` text NOT NULL,
`login` text NOT NULL,
`password` text NOT NULL,
`date_action` date NOT NULL,
`remote_addr` varchar(45) NOT NULL,
`lvl` tinyint(1) NOT NULL,
`isActif` tinyint(1) NOT NULL,
`token` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = MyISAM
DEFAULT CHARSET = utf8;
-- --------------------------------------------------------
--
-- Structure de la table `possede`
--
CREATE TABLE IF NOT EXISTS `possede`
(
`images_id` int(11) NOT NULL,
`membres_id` int(11) NOT NULL,
PRIMARY KEY (`images_id`, `membres_id`),
KEY `membres_id` (`membres_id`)
) ENGINE = MyISAM
DEFAULT CHARSET = utf8;
-- --------------------------------------------------------
--
-- Structure de la table `thumbnails`
--
CREATE TABLE IF NOT EXISTS `thumbnails`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`images_id` int(11) NOT NULL,
`is_preview` tinyint(1) NOT NULL,
`date_action` date NOT NULL,
`new_name` varchar(30) NOT NULL,
`size` int(11) NOT NULL,
`height` int(11) NOT NULL,
`width` int(11) NOT NULL,
`last_view` date NOT NULL,
`nb_view_v4` int(11) NOT NULL,
`nb_view_v6` int(11) NOT NULL,
`md5` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
KEY `images_id` (`images_id`) USING BTREE
) ENGINE = MyISAM
DEFAULT CHARSET = utf8;
--
-- Création du compte administrateur
--
INSERT INTO `membres` (`id`, `email`, `login`, `password`, `date_action`, `remote_addr`, `lvl`, `isActif`,
`token`)
VALUES (1, '[email protected]', 'admin', '$2y$10$2mn2aXq7R2ROZhi9R3H1iO95vSXo0Vd02u3vAdAZSkZhcBq4Vd1bu', DATE(NOW()),
'127.0.0.1', 2, 1, '');
--
-- Images 404 & bannie
--
INSERT INTO `images` (`id`, `remote_addr`, `date_action`, `old_name`, `new_name`, `size`, `height`, `width`, `last_view`,
`nb_view_v4`, `nb_view_v6`, `md5`, `isBloquee`, `isSignalee`, `isApprouvee`, `abuse_network`)
VALUES (1, '127.0.0.1', '2008-01-01 00:00:00', '_image_404.png', '_image_404.png', 30703, 150, 640, '0000-00-00', 0, 0,
'6858ce6ddc171a0fd9640831a5e74dfd', 0, 0, 1, '127.0.0'),
(2, '127.0.0.1', '2008-01-01 00:00:00', '_image_banned.png', '_image_banned.png', 28713, 150, 640, '0000-00-00',
0, 0, '12c357976276091e7cd42e98debb7fb1', 0, 0, 1, '127.0.0');
--
-- Assignation à l'administrateur
--
INSERT INTO `possede` (`images_id`, `membres_id`)
VALUES ('1', '1'),
('2', '1');