[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / maj / vieille_base / 1813 / inc_auxbase.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13
14 if (!defined('_ECRIRE_INC_VERSION')) return;
15
16 // Ce fichier ne sera execute qu'une fois
17 if (defined('_ECRIRE_INC_AUXBASE')) return;
18 define('_ECRIRE_INC_AUXBASE', "1");
19
20 $spip_petitions = array(
21 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL",
22 "email_unique" => "CHAR (3) NOT NULL",
23 "site_obli" => "CHAR (3) NOT NULL",
24 "site_unique" => "CHAR (3) NOT NULL",
25 "message" => "CHAR (3) NOT NULL",
26 "texte" => "LONGBLOB NOT NULL",
27 "maj" => "TIMESTAMP");
28
29 $spip_petitions_key = array(
30 "PRIMARY KEY" => "id_article");
31
32 $spip_visites_temp = array(
33 "ip" => "INT UNSIGNED NOT NULL",
34 "type" => "ENUM ('article', 'rubrique', 'breve', 'autre') NOT NULL",
35 "id_objet" => "INT UNSIGNED NOT NULL",
36 "maj" => "TIMESTAMP");
37
38 $spip_visites_temp_key = array(
39 "PRIMARY KEY" => "type, id_objet, ip");
40
41 $spip_visites = array(
42 "date" => "DATE NOT NULL",
43 "visites" => "INT UNSIGNED NOT NULL",
44 "maj" => "TIMESTAMP");
45
46 $spip_visites_key = array(
47 "PRIMARY KEY" => "date");
48
49 $spip_visites_articles = array(
50 "date" => "DATE NOT NULL",
51 "id_article" => "INT UNSIGNED NOT NULL",
52 "visites" => "INT UNSIGNED NOT NULL",
53 "maj" => "TIMESTAMP");
54
55 $spip_visites_articles_key = array(
56 "PRIMARY KEY" => "date, id_article");
57
58 $spip_referers_temp = array(
59 "ip" => "INT UNSIGNED NOT NULL",
60 "referer" => "VARCHAR (255) NOT NULL",
61 "referer_md5" => "BIGINT UNSIGNED NOT NULL",
62 "type" => "ENUM ('article', 'rubrique', 'breve', 'autre') NOT NULL",
63 "id_objet" => "INT UNSIGNED NOT NULL",
64 "maj" => "TIMESTAMP");
65
66 $spip_referers_temp_key = array(
67 "PRIMARY KEY" => "type, id_objet, referer_md5, ip");
68
69 $spip_referers = array(
70 "referer_md5" => "BIGINT UNSIGNED NOT NULL",
71 "date" => "DATE NOT NULL",
72 "referer" => "VARCHAR (255) NOT NULL",
73 "visites" => "INT UNSIGNED NOT NULL",
74 "visites_jour" => "INT UNSIGNED NOT NULL",
75 "visites_veille"=> "INT UNSIGNED NOT NULL",
76 "maj" => "TIMESTAMP");
77
78 $spip_referers_key = array(
79 "PRIMARY KEY" => "referer_md5");
80
81 $spip_referers_articles = array(
82 "id_article" => "INT UNSIGNED NOT NULL",
83 "referer_md5" => "BIGINT UNSIGNED NOT NULL",
84 "date" => "DATE NOT NULL",
85 "referer" => "VARCHAR (255) NOT NULL",
86 "visites" => "INT UNSIGNED NOT NULL",
87 "maj" => "TIMESTAMP");
88
89 $spip_referers_articles_key = array(
90 "PRIMARY KEY" => "id_article, referer_md5",
91 "KEY referer_md5" => "referer_md5");
92
93 $spip_auteurs_articles = array(
94 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
95 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
96
97 $spip_auteurs_articles_key = array(
98 "KEY id_auteur" => "id_auteur",
99 "KEY id_article" => "id_article");
100
101 $spip_auteurs_rubriques = array(
102 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
103 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
104
105 $spip_auteurs_rubriques_key = array(
106 "KEY id_auteur" => "id_auteur",
107 "KEY id_rubrique" => "id_rubrique");
108
109 $spip_auteurs_messages = array(
110 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
111 "id_message" => "BIGINT (21) DEFAULT '0' NOT NULL",
112 "vu" => "CHAR (3) NOT NULL");
113
114 $spip_auteurs_messages_key = array(
115 "KEY id_auteur" => "id_auteur",
116 "KEY id_message" => "id_message");
117
118
119 $spip_documents_articles = array(
120 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
121 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
122
123 $spip_documents_articles_key = array(
124 "KEY id_document" => "id_document",
125 "KEY id_article" => "id_article");
126
127 $spip_documents_rubriques = array(
128 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
129 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
130
131 $spip_documents_rubriques_key = array(
132 "KEY id_document" => "id_document",
133 "KEY id_rubrique" => "id_rubrique");
134
135 $spip_documents_breves = array(
136 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
137 "id_breve" => "BIGINT (21) DEFAULT '0' NOT NULL");
138
139 $spip_documents_breves_key = array(
140 "KEY id_document" => "id_document",
141 "KEY id_breve" => "id_breve");
142
143 $spip_mots_articles = array(
144 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
145 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
146
147 $spip_mots_articles_key = array(
148 "KEY id_mot" => "id_mot",
149 "KEY id_article" => "id_article");
150
151 $spip_mots_breves = array(
152 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
153 "id_breve" => "BIGINT (21) DEFAULT '0' NOT NULL");
154
155 $spip_mots_breves_key = array(
156 "KEY id_mot" => "id_mot",
157 "KEY id_breve" => "id_breve");
158
159 $spip_mots_rubriques = array(
160 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
161 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
162
163 $spip_mots_rubriques_key = array(
164 "KEY id_mot" => "id_mot",
165 "KEY id_rubrique" => "id_rubrique");
166
167 $spip_mots_syndic = array(
168 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
169 "id_syndic" => "BIGINT (21) DEFAULT '0' NOT NULL");
170
171 $spip_mots_syndic_key = array(
172 "KEY id_mot" => "id_mot",
173 "KEY id_syndic" => "id_syndic");
174
175 $spip_mots_forum = array(
176 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
177 "id_forum" => "BIGINT (21) DEFAULT '0' NOT NULL");
178
179 $spip_mots_forum_key = array(
180 "KEY id_mot" => "id_mot",
181 "KEY id_forum" => "id_forum");
182
183 $spip_meta = array(
184 "nom" => "VARCHAR (255) NOT NULL",
185 "valeur" => "VARCHAR (255) DEFAULT ''",
186 "maj" => "TIMESTAMP");
187
188 $spip_meta_key = array(
189 "PRIMARY KEY" => "nom");
190
191 $spip_index_articles = array(
192 "`hash`" => "BIGINT UNSIGNED NOT NULL",
193 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
194 "id_article" => "INT UNSIGNED NOT NULL");
195
196 $spip_index_articles_key = array(
197 "KEY `hash`" => "`hash`",
198 "KEY id_article" => "id_article");
199
200 $spip_index_auteurs = array(
201 "`hash`" => "BIGINT UNSIGNED NOT NULL",
202 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
203 "id_auteur" => "INT UNSIGNED NOT NULL");
204
205 $spip_index_auteurs_key = array(
206 "KEY `hash`" => "`hash`",
207 "KEY id_auteur" => "id_auteur");
208
209 $spip_index_breves = array(
210 "`hash`" => "BIGINT UNSIGNED NOT NULL",
211 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
212 "id_breve" => "INT UNSIGNED NOT NULL");
213
214 $spip_index_breves_key = array(
215 "KEY `hash`" => "`hash`",
216 "KEY id_breve" => "id_breve");
217
218 $spip_index_mots = array(
219 "`hash`" => "BIGINT UNSIGNED NOT NULL",
220 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
221 "id_mot" => "INT UNSIGNED NOT NULL");
222
223 $spip_index_mots_key = array(
224 "KEY `hash`" => "`hash`",
225 "KEY id_mot" => "id_mot");
226
227 $spip_index_rubriques = array(
228 "`hash`" => "BIGINT UNSIGNED NOT NULL",
229 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
230 "id_rubrique" => "INT UNSIGNED NOT NULL");
231
232 $spip_index_rubriques_key = array(
233 "KEY `hash`" => "`hash`",
234 "KEY id_rubrique" => "id_rubrique");
235
236 $spip_index_syndic = array(
237 "`hash`" => "BIGINT UNSIGNED NOT NULL",
238 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
239 "id_syndic" => "INT UNSIGNED NOT NULL");
240
241 $spip_index_syndic_key = array(
242 "KEY `hash`" => "`hash`",
243 "KEY id_syndic" => "id_syndic");
244
245 $spip_index_signatures = array(
246 "`hash`" => "BIGINT UNSIGNED NOT NULL",
247 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
248 "id_signature" => "INT UNSIGNED NOT NULL");
249
250 $spip_index_signatures_key = array(
251 "KEY `hash`" => "`hash`",
252 "KEY id_signature" => "id_signature");
253
254 $spip_index_forum = array(
255 "`hash`" => "BIGINT UNSIGNED NOT NULL",
256 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
257 "id_forum" => "INT UNSIGNED NOT NULL");
258
259 $spip_index_forum_key = array(
260 "KEY `hash`" => "`hash`",
261 "KEY id_forum" => "id_forum");
262
263 $spip_index_dico = array(
264 "`hash`" => "BIGINT UNSIGNED NOT NULL",
265 "dico" => "VARCHAR (30) NOT NULL");
266
267 $spip_index_dico_key = array(
268 "PRIMARY KEY" => "dico");
269
270 $spip_versions = array (
271 "id_article" => "bigint(21) NOT NULL",
272 "id_version" => "int unsigned DEFAULT '0' NOT NULL",
273 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
274 "id_auteur" => "bigint(21) NOT NULL",
275 "titre_version" => "text DEFAULT '' NOT NULL",
276 "permanent" => "char(3) NOT NULL",
277 "champs" => "text NOT NULL");
278
279 $spip_versions_key = array (
280 "PRIMARY KEY" => "id_article, id_version",
281 "KEY date" => "id_article, date",
282 "KEY id_auteur" => "id_auteur");
283
284 $spip_versions_fragments = array(
285 "id_fragment" => "int unsigned DEFAULT '0' NOT NULL",
286 "version_min" => "int unsigned DEFAULT '0' NOT NULL",
287 "version_max" => "int unsigned DEFAULT '0' NOT NULL",
288 "id_article" => "bigint(21) NOT NULL",
289 "compress" => "tinyint NOT NULL",
290 "fragment" => "longblob NOT NULL");
291
292 $spip_versions_fragments_key = array(
293 "PRIMARY KEY" => "id_article, id_fragment, version_min");
294
295 $spip_caches = array(
296 "fichier" => "char (64) NOT NULL",
297 "id" => "char (64) NOT NULL",
298 // i=par id, t=timer, x=suppression
299 "type" => "CHAR (1) DEFAULT 'i' NOT NULL",
300 "taille" => "integer DEFAULT '0' NOT NULL");
301 $spip_caches_key = array(
302 "PRIMARY KEY" => "fichier, id",
303 "KEY fichier" => "fichier",
304 "KEY id" => "id");
305
306 $spip_ortho_cache = array(
307 "lang" => "VARCHAR(10) NOT NULL",
308 "mot" => "VARCHAR(255) BINARY NOT NULL",
309 "ok" => "TINYINT NOT NULL",
310 "suggest" => "BLOB NOT NULL",
311 "maj" => "TIMESTAMP");
312 $spip_ortho_cache_key = array(
313 "PRIMARY KEY" => "lang, mot",
314 "KEY maj" => "maj");
315
316 $spip_ortho_dico = array(
317 "lang" => "VARCHAR(10) NOT NULL",
318 "mot" => "VARCHAR(255) BINARY NOT NULL",
319 "id_auteur" => "BIGINT UNSIGNED NOT NULL",
320 "maj" => "TIMESTAMP");
321 $spip_ortho_dico_key = array(
322 "PRIMARY KEY" => "lang, mot",);
323
324
325 global $tables_auxiliaires;
326
327 $tables_auxiliaires =
328 array(
329 'spip_petitions' => array('field' => &$spip_petitions,
330 'key' => &$spip_petitions_key),
331 'spip_visites_temp' => array('field' => &$spip_visites_temp,
332 'key' => &$spip_visites_temp_key),
333 'spip_visites' => array('field' => &$spip_visites,
334 'key' => &$spip_visites_key),
335 'spip_visites_articles' => array('field' => &$spip_visites_articles,
336 'key' => &$spip_visites_articles_key),
337 'spip_referers_temp' => array('field' => &$spip_referers_temp,
338 'key' => &$spip_referers_temp_key),
339 'spip_referers' => array('field' => &$spip_referers,
340 'key' => &$spip_referers_key),
341 'spip_referers_articles' => array('field' => &$spip_referers_articles,
342 'key' => &$spip_referers_articles_key),
343 'spip_auteurs_articles' => array('field' => &$spip_auteurs_articles,
344 'key' => &$spip_auteurs_articles_key),
345 'spip_auteurs_rubriques' => array('field' => &$spip_auteurs_rubriques,
346 'key' => &$spip_auteurs_rubriques_key),
347 'spip_auteurs_messages' => array('field' => &$spip_auteurs_messages,
348 'key' => &$spip_auteurs_messages_key),
349 'spip_documents_articles' => array('field' => &$spip_documents_articles,
350 'key' => &$spip_documents_articles_key),
351 'spip_documents_rubriques' => array('field' => &$spip_documents_rubriques,
352 'key' => &$spip_documents_rubriques_key),
353 'spip_documents_breves' => array('field' => &$spip_documents_breves,
354 'key' => &$spip_documents_breves_key),
355 'spip_mots_articles' => array('field' => &$spip_mots_articles,
356 'key' => &$spip_mots_articles_key),
357 'spip_mots_breves' => array('field' => &$spip_mots_breves,
358 'key' => &$spip_mots_breves_key),
359 'spip_mots_rubriques' => array('field' => &$spip_mots_rubriques,
360 'key' => &$spip_mots_rubriques_key),
361 'spip_mots_syndic' => array('field' => &$spip_mots_syndic,
362 'key' => &$spip_mots_syndic_key),
363 'spip_mots_forum' => array('field' => &$spip_mots_forum,
364 'key' => &$spip_mots_forum_key),
365 'spip_meta' => array('field' => &$spip_meta,
366 'key' => &$spip_meta_key),
367 'spip_index_articles' => array('field' => &$spip_index_articles,
368 'key' => &$spip_index_articles_key),
369 'spip_index_auteurs' => array('field' => &$spip_index_auteurs,
370 'key' => &$spip_index_auteurs_key),
371 'spip_index_breves' => array('field' => &$spip_index_breves,
372 'key' => &$spip_index_breves_key),
373 'spip_index_mots' => array('field' => &$spip_index_mots,
374 'key' => &$spip_index_mots_key),
375 'spip_index_rubriques' => array('field' => &$spip_index_rubriques,
376 'key' => &$spip_index_rubriques_key),
377 'spip_index_syndic' => array('field' => &$spip_index_syndic,
378 'key' => &$spip_index_syndic_key),
379 'spip_index_signatures' => array('field' => &$spip_index_signatures,
380 'key' => &$spip_index_signatures_key),
381 'spip_index_forum' => array('field' => &$spip_index_forum,
382 'key' => &$spip_index_forum_key),
383 'spip_index_dico' => array('field' => &$spip_index_dico,
384 'key' => &$spip_index_dico_key),
385 'spip_versions' => array('field' => &$spip_versions,
386 'key' => &$spip_versions_key),
387 'spip_versions_fragments' => array('field' => &$spip_versions_fragments,
388 'key' => &$spip_versions_fragments_key),
389 'spip_caches' => array('field' => &$spip_caches,
390 'key' => &$spip_caches_key),
391 'spip_ortho_cache' => array('field' => &$spip_ortho_cache,
392 'key' => &$spip_ortho_cache_key),
393 'spip_ortho_dico' => array('field' => &$spip_ortho_dico,
394 'key' => &$spip_ortho_dico_key)
395 );
396
397
398 //
399 // tableau des tables de relations,
400 // Ex: gestion du critere {id_mot} dans la boucle(ARTICLES)
401 // transposee en tables_jointures pour le code moderne
402 //
403 global $tables_jointures;
404
405 $tables_jointures['spip_articles']['id_mot']='mots_articles';
406 $tables_jointures['spip_articles']['id_auteur']='auteurs_articles';
407 $tables_jointures['spip_articles']['id_document']='documents_articles';
408
409 $tables_jointures['spip_auteurs']['id_article']='auteurs_articles';
410
411 $tables_jointures['spip_breves']['id_mot']='mots_breves';
412 $tables_jointures['spip_breves']['id_document']='documents_breves';
413
414 $tables_jointures['spip_documents']['id_article']='documents_articles';
415 $tables_jointures['spip_documents']['id_rubrique']='documents_rubriques';
416 $tables_jointures['spip_documents']['id_breve']='documents_breves';
417
418 $tables_jointures['spip_forums']['id_mot']='mots_forum';
419
420 $tables_jointures['spip_mots']['id_article']='mots_articles';
421 $tables_jointures['spip_mots']['id_breve']='mots_breves';
422 $tables_jointures['spip_mots']['id_forum']='mots_forum';
423 $tables_jointures['spip_mots']['id_rubrique']='mots_rubriques';
424 $tables_jointures['spip_mots']['id_syndic']='mots_syndic';
425
426 $tables_jointures['spip_groupes_mots']['id_groupe']='mots';
427
428 $tables_jointures['spip_rubriques']['id_mot']='mots_rubriques';
429 $tables_jointures['spip_rubriques']['id_document']='documents_rubriques';
430
431 $tables_jointures['spip_syndication']['id_mot']='mots_syndic';
432
433 ?>