[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / maj / vieille_base / 1927 / 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 "PRIMARY KEY" => "id_article, id_document",
101 "KEY id_document" => "id_document");
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 "PRIMARY KEY" => "id_rubrique, id_document",
109 "KEY id_document" => "id_document");
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 "PRIMARY KEY" => "id_breve, id_document",
117 "KEY id_document" => "id_document");
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 "impt" => "ENUM('non', 'oui') DEFAULT 'oui' NOT NULL",
171 "maj" => "TIMESTAMP");
172
173 $spip_meta_key = array(
174 "PRIMARY KEY" => "nom");
175
176 $spip_index = array(
177 "`hash`" => "BIGINT UNSIGNED NOT NULL",
178 "points" => "INT UNSIGNED DEFAULT '0' NOT NULL",
179 "id_objet" => "INT UNSIGNED NOT NULL",
180 "id_table" => "TINYINT UNSIGNED NOT NULL" );
181
182 $spip_index_key = array(
183 "KEY `hash`" => "`hash`",
184 "KEY id_objet" => "id_objet",
185 "KEY id_table" => "id_table");
186
187 $spip_index_dico = array(
188 "`hash`" => "BIGINT UNSIGNED NOT NULL",
189 "dico" => "VARCHAR (30) NOT NULL");
190
191 $spip_index_dico_key = array(
192 "PRIMARY KEY" => "dico");
193
194 $spip_versions = array (
195 "id_article" => "bigint(21) NOT NULL",
196 "id_version" => "int unsigned DEFAULT '0' NOT NULL",
197 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
198 "id_auteur" => "VARCHAR(23) NOT NULL", # stocke aussi IP(v6)
199 "titre_version" => "text DEFAULT '' NOT NULL",
200 "permanent" => "char(3) NOT NULL",
201 "champs" => "text NOT NULL");
202
203 $spip_versions_key = array (
204 "PRIMARY KEY" => "id_article, id_version",
205 "KEY date" => "id_article, date",
206 "KEY id_auteur" => "id_auteur");
207
208 $spip_versions_fragments = array(
209 "id_fragment" => "int unsigned DEFAULT '0' NOT NULL",
210 "version_min" => "int unsigned DEFAULT '0' NOT NULL",
211 "version_max" => "int unsigned DEFAULT '0' NOT NULL",
212 "id_article" => "bigint(21) NOT NULL",
213 "compress" => "tinyint NOT NULL",
214 "fragment" => "longblob NOT NULL");
215
216 $spip_versions_fragments_key = array(
217 "PRIMARY KEY" => "id_article, id_fragment, version_min");
218
219 $spip_caches = array(
220 "fichier" => "char (64) NOT NULL",
221 "id" => "char (64) NOT NULL",
222 // i=par id, t=timer, x=suppression
223 "type" => "CHAR (1) DEFAULT 'i' NOT NULL",
224 "taille" => "integer DEFAULT '0' NOT NULL");
225 $spip_caches_key = array(
226 "PRIMARY KEY" => "fichier, id",
227 "KEY fichier" => "fichier",
228 "KEY id" => "id");
229
230 $spip_ortho_cache = array(
231 "lang" => "VARCHAR(10) NOT NULL",
232 "mot" => "VARCHAR(255) BINARY NOT NULL",
233 "ok" => "TINYINT NOT NULL",
234 "suggest" => "BLOB NOT NULL",
235 "maj" => "TIMESTAMP");
236 $spip_ortho_cache_key = array(
237 "PRIMARY KEY" => "lang, mot",
238 "KEY maj" => "maj");
239
240 $spip_ortho_dico = array(
241 "lang" => "VARCHAR(10) NOT NULL",
242 "mot" => "VARCHAR(255) BINARY NOT NULL",
243 "id_auteur" => "BIGINT UNSIGNED NOT NULL",
244 "maj" => "TIMESTAMP");
245 $spip_ortho_dico_key = array(
246 "PRIMARY KEY" => "lang, mot");
247
248
249
250
251 global $tables_auxiliaires;
252
253 $tables_auxiliaires['spip_petitions'] = array(
254 'field' => &$spip_petitions,
255 'key' => &$spip_petitions_key
256 );
257 $tables_auxiliaires['spip_visites'] = array(
258 'field' => &$spip_visites,
259 'key' => &$spip_visites_key);
260 $tables_auxiliaires['spip_visites_articles'] = array(
261 'field' => &$spip_visites_articles,
262 'key' => &$spip_visites_articles_key);
263 $tables_auxiliaires['spip_referers'] = array(
264 'field' => &$spip_referers,
265 'key' => &$spip_referers_key);
266 $tables_auxiliaires['spip_referers_articles'] = array(
267 'field' => &$spip_referers_articles,
268 'key' => &$spip_referers_articles_key);
269 $tables_auxiliaires['spip_auteurs_articles'] = array(
270 'field' => &$spip_auteurs_articles,
271 'key' => &$spip_auteurs_articles_key);
272 $tables_auxiliaires['spip_auteurs_rubriques'] = array(
273 'field' => &$spip_auteurs_rubriques,
274 'key' => &$spip_auteurs_rubriques_key);
275 $tables_auxiliaires['spip_auteurs_messages'] = array(
276 'field' => &$spip_auteurs_messages,
277 'key' => &$spip_auteurs_messages_key);
278 $tables_auxiliaires['spip_documents_articles'] = array(
279 'field' => &$spip_documents_articles,
280 'key' => &$spip_documents_articles_key);
281 $tables_auxiliaires['spip_documents_rubriques'] = array(
282 'field' => &$spip_documents_rubriques,
283 'key' => &$spip_documents_rubriques_key);
284 $tables_auxiliaires['spip_documents_breves'] = array(
285 'field' => &$spip_documents_breves,
286 'key' => &$spip_documents_breves_key);
287 $tables_auxiliaires['spip_mots_articles'] = array(
288 'field' => &$spip_mots_articles,
289 'key' => &$spip_mots_articles_key);
290 $tables_auxiliaires['spip_mots_breves'] = array(
291 'field' => &$spip_mots_breves,
292 'key' => &$spip_mots_breves_key);
293 $tables_auxiliaires['spip_mots_rubriques'] = array(
294 'field' => &$spip_mots_rubriques,
295 'key' => &$spip_mots_rubriques_key);
296 $tables_auxiliaires['spip_mots_syndic'] = array(
297 'field' => &$spip_mots_syndic,
298 'key' => &$spip_mots_syndic_key);
299 $tables_auxiliaires['spip_mots_forum'] = array(
300 'field' => &$spip_mots_forum,
301 'key' => &$spip_mots_forum_key);
302 $tables_auxiliaires['spip_mots_documents'] = array(
303 'field' => &$spip_mots_documents,
304 'key' => &$spip_mots_documents_key);
305 $tables_auxiliaires['spip_meta'] = array(
306 'field' => &$spip_meta,
307 'key' => &$spip_meta_key);
308 $tables_auxiliaires['spip_index'] = array(
309 'field' => &$spip_index,
310 'key' => &$spip_index_key);
311 $tables_auxiliaires['spip_index_dico'] = array(
312 'field' => &$spip_index_dico,
313 'key' => &$spip_index_dico_key);
314 $tables_auxiliaires['spip_versions'] = array(
315 'field' => &$spip_versions,
316 'key' => &$spip_versions_key);
317 $tables_auxiliaires['spip_versions_fragments'] = array(
318 'field' => &$spip_versions_fragments,
319 'key' => &$spip_versions_fragments_key);
320 $tables_auxiliaires['spip_caches'] = array(
321 'field' => &$spip_caches,
322 'key' => &$spip_caches_key);
323 $tables_auxiliaires['spip_ortho_cache'] = array(
324 'field' => &$spip_ortho_cache,
325 'key' => &$spip_ortho_cache_key);
326 $tables_auxiliaires['spip_ortho_dico'] = array(
327 'field' => &$spip_ortho_dico,
328 'key' => &$spip_ortho_dico_key);
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 ?>