[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / maj / vieille_base / 1915 / auxiliaires.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 $spip_petitions = array(
17 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL",
18 "email_unique" => "CHAR (3) NOT NULL",
19 "site_obli" => "CHAR (3) NOT NULL",
20 "site_unique" => "CHAR (3) NOT NULL",
21 "message" => "CHAR (3) NOT NULL",
22 "texte" => "LONGBLOB NOT NULL",
23 "maj" => "TIMESTAMP");
24
25 $spip_petitions_key = array(
26 "PRIMARY KEY" => "id_article");
27
28 $spip_visites = array(
29 "date" => "DATE NOT NULL",
30 "visites" => "INT UNSIGNED NOT NULL",
31 "maj" => "TIMESTAMP");
32
33 $spip_visites_key = array(
34 "PRIMARY KEY" => "date");
35
36 $spip_visites_articles = array(
37 "date" => "DATE NOT NULL",
38 "id_article" => "INT UNSIGNED NOT NULL",
39 "visites" => "INT UNSIGNED NOT NULL",
40 "maj" => "TIMESTAMP");
41
42 $spip_visites_articles_key = array(
43 "PRIMARY KEY" => "date, id_article");
44
45 $spip_referers = array(
46 "referer_md5" => "BIGINT UNSIGNED NOT NULL",
47 "date" => "DATE NOT NULL",
48 "referer" => "VARCHAR (255) NOT NULL",
49 "visites" => "INT UNSIGNED NOT NULL",
50 "visites_jour" => "INT UNSIGNED NOT NULL",
51 "visites_veille"=> "INT UNSIGNED NOT NULL",
52 "maj" => "TIMESTAMP");
53
54 $spip_referers_key = array(
55 "PRIMARY KEY" => "referer_md5");
56
57 $spip_referers_articles = array(
58 "id_article" => "INT UNSIGNED NOT NULL",
59 "referer_md5" => "BIGINT UNSIGNED NOT NULL",
60 "date" => "DATE NOT NULL",
61 "referer" => "VARCHAR (255) NOT NULL",
62 "visites" => "INT UNSIGNED NOT NULL",
63 "maj" => "TIMESTAMP");
64
65 $spip_referers_articles_key = array(
66 "PRIMARY KEY" => "id_article, referer_md5",
67 "KEY referer_md5" => "referer_md5");
68
69 $spip_auteurs_articles = array(
70 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
71 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
72
73 $spip_auteurs_articles_key = array(
74 "PRIMARY KEY" => "id_auteur, id_article",
75 "KEY id_article" => "id_article");
76
77 $spip_auteurs_rubriques = array(
78 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
79 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
80
81 $spip_auteurs_rubriques_key = array(
82 "PRIMARY KEY" => "id_auteur, id_rubrique",
83 "KEY id_rubrique" => "id_rubrique");
84
85 $spip_auteurs_messages = array(
86 "id_auteur" => "BIGINT (21) DEFAULT '0' NOT NULL",
87 "id_message" => "BIGINT (21) DEFAULT '0' NOT NULL",
88 "vu" => "CHAR (3) NOT NULL");
89
90 $spip_auteurs_messages_key = array(
91 "PRIMARY KEY" => "id_auteur, id_message",
92 "KEY id_message" => "id_message");
93
94
95 $spip_documents_articles = array(
96 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
97 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
98
99 $spip_documents_articles_key = array(
100 "KEY id_document" => "id_document",
101 "KEY id_article" => "id_article");
102
103 $spip_documents_rubriques = array(
104 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
105 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
106
107 $spip_documents_rubriques_key = array(
108 "KEY id_document" => "id_document",
109 "KEY id_rubrique" => "id_rubrique");
110
111 $spip_documents_breves = array(
112 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL",
113 "id_breve" => "BIGINT (21) DEFAULT '0' NOT NULL");
114
115 $spip_documents_breves_key = array(
116 "KEY id_document" => "id_document",
117 "KEY id_breve" => "id_breve");
118
119 $spip_mots_articles = array(
120 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
121 "id_article" => "BIGINT (21) DEFAULT '0' NOT NULL");
122
123 $spip_mots_articles_key = array(
124 "PRIMARY KEY" => "id_article, id_mot",
125 "KEY id_mot" => "id_mot");
126
127 $spip_mots_breves = array(
128 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
129 "id_breve" => "BIGINT (21) DEFAULT '0' NOT NULL");
130
131 $spip_mots_breves_key = array(
132 "PRIMARY KEY" => "id_breve, id_mot",
133 "KEY id_mot" => "id_mot");
134
135 $spip_mots_rubriques = array(
136 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
137 "id_rubrique" => "BIGINT (21) DEFAULT '0' NOT NULL");
138
139 $spip_mots_rubriques_key = array(
140 "PRIMARY KEY" => "id_rubrique, id_mot",
141 "KEY id_mot" => "id_mot");
142
143 $spip_mots_syndic = array(
144 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
145 "id_syndic" => "BIGINT (21) DEFAULT '0' NOT NULL");
146
147 $spip_mots_syndic_key = array(
148 "PRIMARY KEY" => "id_syndic, id_mot",
149 "KEY id_mot" => "id_mot");
150
151 $spip_mots_forum = array(
152 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
153 "id_forum" => "BIGINT (21) DEFAULT '0' NOT NULL");
154
155 $spip_mots_forum_key = array(
156 "PRIMARY KEY" => "id_forum, id_mot",
157 "KEY id_mot" => "id_mot");
158
159 $spip_mots_documents = array(
160 "id_mot" => "BIGINT (21) DEFAULT '0' NOT NULL",
161 "id_document" => "BIGINT (21) DEFAULT '0' NOT NULL");
162
163 $spip_mots_documents_key = array(
164 "PRIMARY KEY" => "id_document, id_mot",
165 "KEY id_mot" => "id_mot");
166
167 $spip_meta = array(
168 "nom" => "VARCHAR (255) NOT NULL",
169 "valeur" => "text DEFAULT ''",
170 "maj" => "TIMESTAMP");
171
172 $spip_meta_key = array(
173 "PRIMARY KEY" => "nom");
174
175 $spip_index = array(
176 "`hash`" => "BIGINT UNSIGNED NOT NULL",
177 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
178 "id_objet" => "INT UNSIGNED NOT NULL",
179 "id_table" => "TINYINT UNSIGNED NOT NULL" );
180
181 $spip_index_key = array(
182 "KEY `hash`" => "`hash`",
183 "KEY id_objet" => "id_objet",
184 "KEY id_table" => "id_table");
185
186 $spip_index_dico = array(
187 "`hash`" => "BIGINT UNSIGNED NOT NULL",
188 "dico" => "VARCHAR (30) NOT NULL");
189
190 $spip_index_dico_key = array(
191 "PRIMARY KEY" => "dico");
192
193 $spip_versions = array (
194 "id_article" => "bigint(21) NOT NULL",
195 "id_version" => "int unsigned DEFAULT '0' NOT NULL",
196 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
197 "id_auteur" => "bigint(21) NOT NULL",
198 "titre_version" => "text DEFAULT '' NOT NULL",
199 "permanent" => "char(3) NOT NULL",
200 "champs" => "text NOT NULL");
201
202 $spip_versions_key = array (
203 "PRIMARY KEY" => "id_article, id_version",
204 "KEY date" => "id_article, date",
205 "KEY id_auteur" => "id_auteur");
206
207 $spip_versions_fragments = array(
208 "id_fragment" => "int unsigned DEFAULT '0' NOT NULL",
209 "version_min" => "int unsigned DEFAULT '0' NOT NULL",
210 "version_max" => "int unsigned DEFAULT '0' NOT NULL",
211 "id_article" => "bigint(21) NOT NULL",
212 "compress" => "tinyint NOT NULL",
213 "fragment" => "longblob NOT NULL");
214
215 $spip_versions_fragments_key = array(
216 "PRIMARY KEY" => "id_article, id_fragment, version_min");
217
218 $spip_caches = array(
219 "fichier" => "char (64) NOT NULL",
220 "id" => "char (64) NOT NULL",
221 // i=par id, t=timer, x=suppression
222 "type" => "CHAR (1) DEFAULT 'i' NOT NULL",
223 "taille" => "integer DEFAULT '0' NOT NULL");
224 $spip_caches_key = array(
225 "PRIMARY KEY" => "fichier, id",
226 "KEY fichier" => "fichier",
227 "KEY id" => "id");
228
229 $spip_ortho_cache = array(
230 "lang" => "VARCHAR(10) NOT NULL",
231 "mot" => "VARCHAR(255) BINARY NOT NULL",
232 "ok" => "TINYINT NOT NULL",
233 "suggest" => "BLOB NOT NULL",
234 "maj" => "TIMESTAMP");
235 $spip_ortho_cache_key = array(
236 "PRIMARY KEY" => "lang, mot",
237 "KEY maj" => "maj");
238
239 $spip_ortho_dico = array(
240 "lang" => "VARCHAR(10) NOT NULL",
241 "mot" => "VARCHAR(255) BINARY NOT NULL",
242 "id_auteur" => "BIGINT UNSIGNED NOT NULL",
243 "maj" => "TIMESTAMP");
244 $spip_ortho_dico_key = array(
245 "PRIMARY KEY" => "lang, mot");
246
247
248
249
250 global $tables_auxiliaires;
251
252 $tables_auxiliaires['spip_petitions'] = array(
253 'field' => &$spip_petitions,
254 'key' => &$spip_petitions_key
255 );
256 $tables_auxiliaires['spip_visites'] = array(
257 'field' => &$spip_visites,
258 'key' => &$spip_visites_key);
259 $tables_auxiliaires['spip_visites_articles'] = array(
260 'field' => &$spip_visites_articles,
261 'key' => &$spip_visites_articles_key);
262 $tables_auxiliaires['spip_referers'] = array(
263 'field' => &$spip_referers,
264 'key' => &$spip_referers_key);
265 $tables_auxiliaires['spip_referers_articles'] = array(
266 'field' => &$spip_referers_articles,
267 'key' => &$spip_referers_articles_key);
268 $tables_auxiliaires['spip_auteurs_articles'] = array(
269 'field' => &$spip_auteurs_articles,
270 'key' => &$spip_auteurs_articles_key);
271 $tables_auxiliaires['spip_auteurs_rubriques'] = array(
272 'field' => &$spip_auteurs_rubriques,
273 'key' => &$spip_auteurs_rubriques_key);
274 $tables_auxiliaires['spip_auteurs_messages'] = array(
275 'field' => &$spip_auteurs_messages,
276 'key' => &$spip_auteurs_messages_key);
277 $tables_auxiliaires['spip_documents_articles'] = array(
278 'field' => &$spip_documents_articles,
279 'key' => &$spip_documents_articles_key);
280 $tables_auxiliaires['spip_documents_rubriques'] = array(
281 'field' => &$spip_documents_rubriques,
282 'key' => &$spip_documents_rubriques_key);
283 $tables_auxiliaires['spip_documents_breves'] = array(
284 'field' => &$spip_documents_breves,
285 'key' => &$spip_documents_breves_key);
286 $tables_auxiliaires['spip_mots_articles'] = array(
287 'field' => &$spip_mots_articles,
288 'key' => &$spip_mots_articles_key);
289 $tables_auxiliaires['spip_mots_breves'] = array(
290 'field' => &$spip_mots_breves,
291 'key' => &$spip_mots_breves_key);
292 $tables_auxiliaires['spip_mots_rubriques'] = array(
293 'field' => &$spip_mots_rubriques,
294 'key' => &$spip_mots_rubriques_key);
295 $tables_auxiliaires['spip_mots_syndic'] = array(
296 'field' => &$spip_mots_syndic,
297 'key' => &$spip_mots_syndic_key);
298 $tables_auxiliaires['spip_mots_forum'] = array(
299 'field' => &$spip_mots_forum,
300 'key' => &$spip_mots_forum_key);
301 $tables_auxiliaires['spip_mots_documents'] = array(
302 'field' => &$spip_mots_documents,
303 'key' => &$spip_mots_documents_key);
304 $tables_auxiliaires['spip_meta'] = array(
305 'field' => &$spip_meta,
306 'key' => &$spip_meta_key);
307 $tables_auxiliaires['spip_index'] = array(
308 'field' => &$spip_index,
309 'key' => &$spip_index_key);
310 $tables_auxiliaires['spip_index_dico'] = array(
311 'field' => &$spip_index_dico,
312 'key' => &$spip_index_dico_key);
313 $tables_auxiliaires['spip_versions'] = array(
314 'field' => &$spip_versions,
315 'key' => &$spip_versions_key);
316 $tables_auxiliaires['spip_versions_fragments'] = array(
317 'field' => &$spip_versions_fragments,
318 'key' => &$spip_versions_fragments_key);
319 $tables_auxiliaires['spip_caches'] = array(
320 'field' => &$spip_caches,
321 'key' => &$spip_caches_key);
322 $tables_auxiliaires['spip_ortho_cache'] = array(
323 'field' => &$spip_ortho_cache,
324 'key' => &$spip_ortho_cache_key);
325 $tables_auxiliaires['spip_ortho_dico'] = array(
326 'field' => &$spip_ortho_dico,
327 'key' => &$spip_ortho_dico_key);
328
329
330 //
331 // tableau des tables de jointures
332 // Ex: gestion du critere {id_mot} dans la boucle(ARTICLES)
333
334 global $tables_jointures;
335
336 $tables_jointures['spip_articles'][]= 'mots_articles';
337 $tables_jointures['spip_articles'][]= 'auteurs_articles';
338 $tables_jointures['spip_articles'][]= 'documents_articles';
339 $tables_jointures['spip_articles'][]= 'mots';
340 $tables_jointures['spip_articles'][]= 'signatures';
341
342 $tables_jointures['spip_auteurs'][]= 'auteurs_articles';
343 $tables_jointures['spip_auteurs'][]= 'mots';
344
345 $tables_jointures['spip_breves'][]= 'mots_breves';
346 $tables_jointures['spip_breves'][]= 'documents_breves';
347 $tables_jointures['spip_breves'][]= 'mots';
348
349 $tables_jointures['spip_documents'][]= 'documents_articles';
350 $tables_jointures['spip_documents'][]= 'documents_rubriques';
351 $tables_jointures['spip_documents'][]= 'documents_breves';
352 $tables_jointures['spip_documents'][]= 'mots_documents';
353 $tables_jointures['spip_documents'][]= 'types_documents';
354 $tables_jointures['spip_documents'][]= 'mots';
355
356 $tables_jointures['spip_forum'][]= 'mots_forum';
357 $tables_jointures['spip_forum'][]= 'mots';
358
359 $tables_jointures['spip_rubriques'][]= 'mots_rubriques';
360 $tables_jointures['spip_rubriques'][]= 'documents_rubriques';
361 $tables_jointures['spip_rubriques'][]= 'mots';
362
363 $tables_jointures['spip_syndic'][]= 'mots_syndic';
364 $tables_jointures['spip_syndic'][]= 'mots';
365
366 $tables_jointures['spip_syndic_articles'][]= 'syndic';
367 $tables_jointures['spip_syndic_articles'][]= 'mots';
368
369 $tables_jointures['spip_mots'][]= 'mots_articles';
370 $tables_jointures['spip_mots'][]= 'mots_breves';
371 $tables_jointures['spip_mots'][]= 'mots_forum';
372 $tables_jointures['spip_mots'][]= 'mots_rubriques';
373 $tables_jointures['spip_mots'][]= 'mots_syndic';
374 $tables_jointures['spip_mots'][]= 'mots_documents';
375
376 $tables_jointures['spip_groupes_mots'][]= 'mots';
377
378 ?>