[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / maj / vieille_base / 1821 / inc_auxbase.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
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_documents_syndic = array(
144 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
145 "id_syndic" => "BIGINT (21) DEFAULT '0' NOT NULL",
146 "id_syndic_article" => "BIGINT (21) DEFAULT '0' NOT NULL"
147 );
148
149 $spip_documents_syndic_key = array(
150 "KEY id_document" => "id_document",
151 "KEY id_syndic" => "id_syndic",
152 "KEY id_syndic_article" => "id_syndic_article");
153
154 $spip_mots_articles = array(
155 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
156 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
157
158 $spip_mots_articles_key = array(
159 "KEY id_mot" => "id_mot",
160 "KEY id_article" => "id_article");
161
162 $spip_mots_breves = array(
163 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
164 "id_breve" => "BIGINT (21) DEFAULT '0' NOT NULL");
165
166 $spip_mots_breves_key = array(
167 "KEY id_mot" => "id_mot",
168 "KEY id_breve" => "id_breve");
169
170 $spip_mots_rubriques = array(
171 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
172 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
173
174 $spip_mots_rubriques_key = array(
175 "KEY id_mot" => "id_mot",
176 "KEY id_rubrique" => "id_rubrique");
177
178 $spip_mots_syndic = array(
179 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
180 "id_syndic" => "BIGINT (21) DEFAULT '0' NOT NULL");
181
182 $spip_mots_syndic_key = array(
183 "KEY id_mot" => "id_mot",
184 "KEY id_syndic" => "id_syndic");
185
186 $spip_mots_forum = array(
187 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
188 "id_forum" => "BIGINT (21) DEFAULT '0' NOT NULL");
189
190 $spip_mots_forum_key = array(
191 "KEY id_mot" => "id_mot",
192 "KEY id_forum" => "id_forum");
193
194 $spip_mots_documents = array(
195 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
196 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL");
197
198 $spip_mots_documents_key = array(
199 "KEY id_mot" => "id_mot",
200 "KEY id_document" => "id_document");
201
202 $spip_meta = array(
203 "nom" => "VARCHAR (255) NOT NULL",
204 "valeur" => "VARCHAR (255) DEFAULT ''",
205 "maj" => "TIMESTAMP");
206
207 $spip_meta_key = array(
208 "PRIMARY KEY" => "nom");
209
210 $spip_index_articles = array(
211 "`hash`" => "BIGINT UNSIGNED NOT NULL",
212 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
213 "id_article" => "INT UNSIGNED NOT NULL");
214
215 $spip_index_articles_key = array(
216 "KEY `hash`" => "`hash`",
217 "KEY id_article" => "id_article");
218
219 $spip_index_auteurs = array(
220 "`hash`" => "BIGINT UNSIGNED NOT NULL",
221 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
222 "id_auteur" => "INT UNSIGNED NOT NULL");
223
224 $spip_index_auteurs_key = array(
225 "KEY `hash`" => "`hash`",
226 "KEY id_auteur" => "id_auteur");
227
228 $spip_index_breves = array(
229 "`hash`" => "BIGINT UNSIGNED NOT NULL",
230 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
231 "id_breve" => "INT UNSIGNED NOT NULL");
232
233 $spip_index_breves_key = array(
234 "KEY `hash`" => "`hash`",
235 "KEY id_breve" => "id_breve");
236
237 $spip_index_mots = array(
238 "`hash`" => "BIGINT UNSIGNED NOT NULL",
239 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
240 "id_mot" => "INT UNSIGNED NOT NULL");
241
242 $spip_index_mots_key = array(
243 "KEY `hash`" => "`hash`",
244 "KEY id_mot" => "id_mot");
245
246 $spip_index_rubriques = array(
247 "`hash`" => "BIGINT UNSIGNED NOT NULL",
248 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
249 "id_rubrique" => "INT UNSIGNED NOT NULL");
250
251 $spip_index_rubriques_key = array(
252 "KEY `hash`" => "`hash`",
253 "KEY id_rubrique" => "id_rubrique");
254
255 $spip_index_syndic = array(
256 "`hash`" => "BIGINT UNSIGNED NOT NULL",
257 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
258 "id_syndic" => "INT UNSIGNED NOT NULL");
259
260 $spip_index_syndic_key = array(
261 "KEY `hash`" => "`hash`",
262 "KEY id_syndic" => "id_syndic");
263
264 $spip_index_signatures = array(
265 "`hash`" => "BIGINT UNSIGNED NOT NULL",
266 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
267 "id_signature" => "INT UNSIGNED NOT NULL");
268
269 $spip_index_signatures_key = array(
270 "KEY `hash`" => "`hash`",
271 "KEY id_signature" => "id_signature");
272
273 $spip_index_forum = array(
274 "`hash`" => "BIGINT UNSIGNED NOT NULL",
275 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
276 "id_forum" => "INT UNSIGNED NOT NULL");
277
278 $spip_index_forum_key = array(
279 "KEY `hash`" => "`hash`",
280 "KEY id_forum" => "id_forum");
281
282 $spip_index_documents = array(
283 "`hash`" => "BIGINT UNSIGNED NOT NULL",
284 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
285 "id_document" => "INT UNSIGNED NOT NULL");
286
287 $spip_index_documents_key = array(
288 "KEY `hash`" => "`hash`",
289 "KEY id_document" => "id_document");
290
291 $spip_index_dico = array(
292 "`hash`" => "BIGINT UNSIGNED NOT NULL",
293 "dico" => "VARCHAR (30) NOT NULL");
294
295 $spip_index_dico_key = array(
296 "PRIMARY KEY" => "dico");
297
298 $spip_versions = array (
299 "id_article" => "bigint(21) NOT NULL",
300 "id_version" => "int unsigned DEFAULT '0' NOT NULL",
301 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
302 "id_auteur" => "bigint(21) NOT NULL",
303 "titre_version" => "text DEFAULT '' NOT NULL",
304 "permanent" => "char(3) NOT NULL",
305 "champs" => "text NOT NULL");
306
307 $spip_versions_key = array (
308 "PRIMARY KEY" => "id_article, id_version",
309 "KEY date" => "id_article, date",
310 "KEY id_auteur" => "id_auteur");
311
312 $spip_versions_fragments = array(
313 "id_fragment" => "int unsigned DEFAULT '0' NOT NULL",
314 "version_min" => "int unsigned DEFAULT '0' NOT NULL",
315 "version_max" => "int unsigned DEFAULT '0' NOT NULL",
316 "id_article" => "bigint(21) NOT NULL",
317 "compress" => "tinyint NOT NULL",
318 "fragment" => "longblob NOT NULL");
319
320 $spip_versions_fragments_key = array(
321 "PRIMARY KEY" => "id_article, id_fragment, version_min");
322
323 $spip_caches = array(
324 "fichier" => "char (64) NOT NULL",
325 "id" => "char (64) NOT NULL",
326 // i=par id, t=timer, x=suppression
327 "type" => "CHAR (1) DEFAULT 'i' NOT NULL",
328 "taille" => "integer DEFAULT '0' NOT NULL");
329 $spip_caches_key = array(
330 "PRIMARY KEY" => "fichier, id",
331 "KEY fichier" => "fichier",
332 "KEY id" => "id");
333
334 $spip_ortho_cache = array(
335 "lang" => "VARCHAR(10) NOT NULL",
336 "mot" => "VARCHAR(255) BINARY NOT NULL",
337 "ok" => "TINYINT NOT NULL",
338 "suggest" => "BLOB NOT NULL",
339 "maj" => "TIMESTAMP");
340 $spip_ortho_cache_key = array(
341 "PRIMARY KEY" => "lang, mot",
342 "KEY maj" => "maj");
343
344 $spip_ortho_dico = array(
345 "lang" => "VARCHAR(10) NOT NULL",
346 "mot" => "VARCHAR(255) BINARY NOT NULL",
347 "id_auteur" => "BIGINT UNSIGNED NOT NULL",
348 "maj" => "TIMESTAMP");
349 $spip_ortho_dico_key = array(
350 "PRIMARY KEY" => "lang, mot",);
351
352
353 global $tables_auxiliaires;
354
355 $tables_auxiliaires =
356 array(
357 'spip_petitions' => array('field' => &$spip_petitions,
358 'key' => &$spip_petitions_key),
359 'spip_visites_temp' => array('field' => &$spip_visites_temp,
360 'key' => &$spip_visites_temp_key),
361 'spip_visites' => array('field' => &$spip_visites,
362 'key' => &$spip_visites_key),
363 'spip_visites_articles' => array('field' => &$spip_visites_articles,
364 'key' => &$spip_visites_articles_key),
365 'spip_referers_temp' => array('field' => &$spip_referers_temp,
366 'key' => &$spip_referers_temp_key),
367 'spip_referers' => array('field' => &$spip_referers,
368 'key' => &$spip_referers_key),
369 'spip_referers_articles' => array('field' => &$spip_referers_articles,
370 'key' => &$spip_referers_articles_key),
371 'spip_auteurs_articles' => array('field' => &$spip_auteurs_articles,
372 'key' => &$spip_auteurs_articles_key),
373 'spip_auteurs_rubriques' => array('field' => &$spip_auteurs_rubriques,
374 'key' => &$spip_auteurs_rubriques_key),
375 'spip_auteurs_messages' => array('field' => &$spip_auteurs_messages,
376 'key' => &$spip_auteurs_messages_key),
377 'spip_documents_articles' => array('field' => &$spip_documents_articles,
378 'key' => &$spip_documents_articles_key),
379 'spip_documents_rubriques' => array('field' => &$spip_documents_rubriques,
380 'key' => &$spip_documents_rubriques_key),
381 'spip_documents_breves' => array('field' => &$spip_documents_breves,
382 'key' => &$spip_documents_breves_key),
383 'spip_documents_syndic' => array('field' => &$spip_documents_syndic,
384 'key' => &$spip_documents_syndic_key),
385 'spip_mots_articles' => array('field' => &$spip_mots_articles,
386 'key' => &$spip_mots_articles_key),
387 'spip_mots_breves' => array('field' => &$spip_mots_breves,
388 'key' => &$spip_mots_breves_key),
389 'spip_mots_rubriques' => array('field' => &$spip_mots_rubriques,
390 'key' => &$spip_mots_rubriques_key),
391 'spip_mots_syndic' => array('field' => &$spip_mots_syndic,
392 'key' => &$spip_mots_syndic_key),
393 'spip_mots_forum' => array('field' => &$spip_mots_forum,
394 'key' => &$spip_mots_forum_key),
395 'spip_mots_documents' => array('field' => &$spip_mots_documents,
396 'key' => &$spip_mots_documents_key),
397 'spip_meta' => array('field' => &$spip_meta,
398 'key' => &$spip_meta_key),
399 'spip_index_articles' => array('field' => &$spip_index_articles,
400 'key' => &$spip_index_articles_key),
401 'spip_index_auteurs' => array('field' => &$spip_index_auteurs,
402 'key' => &$spip_index_auteurs_key),
403 'spip_index_breves' => array('field' => &$spip_index_breves,
404 'key' => &$spip_index_breves_key),
405 'spip_index_mots' => array('field' => &$spip_index_mots,
406 'key' => &$spip_index_mots_key),
407 'spip_index_rubriques' => array('field' => &$spip_index_rubriques,
408 'key' => &$spip_index_rubriques_key),
409 'spip_index_syndic' => array('field' => &$spip_index_syndic,
410 'key' => &$spip_index_syndic_key),
411 'spip_index_signatures' => array('field' => &$spip_index_signatures,
412 'key' => &$spip_index_signatures_key),
413 'spip_index_forum' => array('field' => &$spip_index_forum,
414 'key' => &$spip_index_forum_key),
415 'spip_index_documents' => array('field' => &$spip_index_documents,
416 'key' => &$spip_index_documents_key),
417 'spip_index_dico' => array('field' => &$spip_index_dico,
418 'key' => &$spip_index_dico_key),
419 'spip_versions' => array('field' => &$spip_versions,
420 'key' => &$spip_versions_key),
421 'spip_versions_fragments' => array('field' => &$spip_versions_fragments,
422 'key' => &$spip_versions_fragments_key),
423 'spip_caches' => array('field' => &$spip_caches,
424 'key' => &$spip_caches_key),
425 'spip_ortho_cache' => array('field' => &$spip_ortho_cache,
426 'key' => &$spip_ortho_cache_key),
427 'spip_ortho_dico' => array('field' => &$spip_ortho_dico,
428 'key' => &$spip_ortho_dico_key)
429 );
430
431
432 //
433 // tableau des tables de relations,
434 // Ex: gestion du critere {id_mot} dans la boucle(ARTICLES)
435 // transposee en tables_jointures pour le code moderne
436 //
437 global $tables_jointures;
438
439 $tables_jointures['spip_articles']['id_mot']='mots_articles';
440 $tables_jointures['spip_articles']['id_auteur']='auteurs_articles';
441 $tables_jointures['spip_articles']['id_document']='documents_articles';
442
443 $tables_jointures['spip_auteurs']['id_article']='auteurs_articles';
444
445 $tables_jointures['spip_breves']['id_mot']='mots_breves';
446 $tables_jointures['spip_breves']['id_document']='documents_breves';
447
448 $tables_jointures['spip_documents']['id_article']='documents_articles';
449 $tables_jointures['spip_documents']['id_rubrique']='documents_rubriques';
450 $tables_jointures['spip_documents']['id_breve']='documents_breves';
451 $tables_jointures['spip_documents']['id_syndic']='documents_syndic';
452 $tables_jointures['spip_documents']['id_syndic_article']='documents_syndic';
453 $tables_jointures['spip_documents']['id_mot']='mots_documents';
454
455 $tables_jointures['spip_forums']['id_mot']='mots_forum';
456
457 $tables_jointures['spip_mots']['id_article']='mots_articles';
458 $tables_jointures['spip_mots']['id_breve']='mots_breves';
459 $tables_jointures['spip_mots']['id_forum']='mots_forum';
460 $tables_jointures['spip_mots']['id_rubrique']='mots_rubriques';
461 $tables_jointures['spip_mots']['id_syndic']='mots_syndic';
462 $tables_jointures['spip_mots']['id_document']='mots_documents';
463
464 $tables_jointures['spip_groupes_mots']['id_groupe']='mots';
465
466 $tables_jointures['spip_rubriques']['id_mot']='mots_rubriques';
467 $tables_jointures['spip_rubriques']['id_document']='documents_rubriques';
468
469 $tables_jointures['spip_syndication']['id_mot']='mots_syndic';
470 $tables_jointures['spip_syndication']['id_document']='documents_syndic';
471 $tables_jointures['spip_syndic_articles']['id_document']='documents_syndic';
472
473 ?>