[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / maj / vieille_base / 1821 / inc_serialbase.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_SERIALBASE')) return;
18 define('_ECRIRE_INC_SERIALBASE', "1");
19
20
21 $spip_articles = array(
22 "id_article" => "bigint(21) NOT NULL",
23 "surtitre" => "text NOT NULL",
24 "titre" => "text NOT NULL",
25 "soustitre" => "text NOT NULL",
26 "id_rubrique" => "bigint(21) DEFAULT '0' NOT NULL",
27 "descriptif" => "text NOT NULL",
28 "chapo" => "mediumtext NOT NULL",
29 "texte" => "longblob NOT NULL",
30 "ps" => "mediumtext NOT NULL",
31 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
32 "statut" => "varchar(10) DEFAULT '0' NOT NULL",
33 "id_secteur" => "bigint(21) DEFAULT '0' NOT NULL",
34 "maj" => "TIMESTAMP",
35 "export" => "VARCHAR(10) DEFAULT 'oui'",
36 "date_redac" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
37 "visites" => "INTEGER DEFAULT '0' NOT NULL",
38 "referers" => "INTEGER DEFAULT '0' NOT NULL",
39 "popularite" => "DOUBLE DEFAULT '0' NOT NULL",
40 "accepter_forum" => "CHAR(3) NOT NULL",
41 "auteur_modif" => "bigint(21) DEFAULT '0' NOT NULL",
42 "date_modif" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
43 "lang" => "VARCHAR(10) DEFAULT '' NOT NULL",
44 "langue_choisie" => "VARCHAR(3) DEFAULT 'non'",
45 "id_trad" => "bigint(21) DEFAULT '0' NOT NULL",
46 "extra" => "longblob NULL",
47 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
48 "id_version" => "int unsigned DEFAULT '0' NOT NULL",
49 "nom_site" => "tinytext NOT NULL",
50 "url_site" => "VARCHAR(255) NOT NULL",
51 "url_propre" => "VARCHAR(255) NOT NULL");
52
53 $spip_articles_key = array(
54 "PRIMARY KEY" => "id_article",
55 "KEY id_rubrique" => "id_rubrique",
56 "KEY id_secteur" => "id_secteur",
57 "KEY id_trad" => "id_trad",
58 "KEY lang" => "lang",
59 "KEY statut" => "statut, date",
60 "KEY url_site" => "url_site",
61 "KEY date_modif" => "date_modif",
62 "KEY idx" => "idx",
63 "KEY url_propre" => "url_propre");
64
65 $spip_auteurs = array(
66 "id_auteur" => "bigint(21) NOT NULL",
67 "nom" => "text NOT NULL",
68 "bio" => "text NOT NULL",
69 "email" => "tinytext NOT NULL",
70 "nom_site" => "tinytext NOT NULL",
71 "url_site" => "text NOT NULL",
72 "login" => "VARCHAR(255) BINARY NOT NULL",
73 "pass" => "tinytext NOT NULL",
74 "low_sec" => "tinytext NOT NULL",
75 "statut" => "VARCHAR(255) NOT NULL",
76 "maj" => "TIMESTAMP",
77 "pgp" => "BLOB NOT NULL",
78 "htpass" => "tinyblob NOT NULL",
79 "en_ligne" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
80 "imessage" => "VARCHAR(3) NOT NULL",
81 "messagerie" => "VARCHAR(3) NOT NULL",
82 "alea_actuel" => "tinytext NOT NULL",
83 "alea_futur" => "tinytext NOT NULL",
84 "prefs" => "tinytext NOT NULL",
85 "cookie_oubli" => "tinytext NOT NULL",
86 "source" => "VARCHAR(10) DEFAULT 'spip' NOT NULL",
87 "lang" => "VARCHAR(10) DEFAULT '' NOT NULL",
88 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
89 "url_propre" => "VARCHAR(255) NOT NULL",
90 "extra" => "longblob NULL");
91
92 $spip_auteurs_key = array(
93 "PRIMARY KEY" => "id_auteur",
94 "KEY login" => "login",
95 "KEY statut" => "statut",
96 "KEY lang" => "lang",
97 "KEY idx" => "idx",
98 "KEY en_ligne" => "en_ligne");
99
100 $spip_breves = array(
101 "id_breve" => "bigint(21) NOT NULL",
102 "date_heure" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
103 "titre" => "text NOT NULL",
104 "texte" => "longblob NOT NULL",
105 "lien_titre" => "text NOT NULL",
106 "lien_url" => "text NOT NULL",
107 "statut" => "varchar(6) NOT NULL",
108 "id_rubrique" => "bigint(21) DEFAULT '0' NOT NULL",
109 "lang" => "VARCHAR(10) DEFAULT '' NOT NULL",
110 "langue_choisie" => "VARCHAR(3) DEFAULT 'non'",
111 "maj" => "TIMESTAMP",
112 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
113 "extra" => "longblob NULL",
114 "url_propre" => "VARCHAR(255) NOT NULL");
115
116 $spip_breves_key = array(
117 "PRIMARY KEY" => "id_breve",
118 "KEY idx" => "idx",
119 "KEY id_rubrique" => "id_rubrique",
120 "KEY url_propre" => "url_propre");
121
122 $spip_messages = array(
123 "id_message" => "bigint(21) NOT NULL",
124 "titre" => "text NOT NULL",
125 "texte" => "longblob NOT NULL",
126 "type" => "varchar(6) NOT NULL",
127 "date_heure" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
128 "date_fin" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
129 "rv" => "varchar(3) NOT NULL",
130 "statut" => "varchar(6) NOT NULL",
131 "id_auteur" => "bigint(21) NOT NULL",
132 "maj" => "TIMESTAMP");
133
134 $spip_messages_key = array(
135 "PRIMARY KEY" => "id_message",
136 "KEY id_auteur" => "id_auteur");
137
138 $spip_mots = array(
139 "id_mot" => "bigint(21) NOT NULL",
140 "type" => "VARCHAR(100) NOT NULL",
141 "titre" => "text NOT NULL",
142 "descriptif" => "text NOT NULL",
143 "texte" => "longblob NOT NULL",
144 "id_groupe" => "bigint(21) NOT NULL",
145 "extra" => "longblob NULL",
146 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
147 "url_propre" => "VARCHAR(255) NOT NULL",
148 "maj" => "TIMESTAMP");
149
150 $spip_mots_key = array(
151 "PRIMARY KEY" => "id_mot",
152 "KEY idx" => "idx",
153 "KEY type" => "type",
154 "KEY url_propre" => "url_propre");
155
156 $spip_groupes_mots = array(
157 "id_groupe" => "bigint(21) NOT NULL",
158 "titre" => "text NOT NULL",
159 "descriptif" => "text NOT NULL",
160 "texte" => "longblob NOT NULL",
161 "unseul" => "varchar(3) NOT NULL",
162 "obligatoire" => "varchar(3) NOT NULL",
163 "articles" => "varchar(3) NOT NULL",
164 "breves" => "varchar(3) NOT NULL",
165 "rubriques" => "varchar(3) NOT NULL",
166 "syndic" => "varchar(3) NOT NULL",
167 "minirezo" => "varchar(3) NOT NULL",
168 "comite" => "varchar(3) NOT NULL",
169 "forum" => "varchar(3) NOT NULL",
170 "maj" => "TIMESTAMP");
171
172 $spip_groupes_mots_key = array(
173 "PRIMARY KEY" => "id_groupe");
174
175 $spip_rubriques = array(
176 "id_rubrique" => "bigint(21) NOT NULL",
177 "id_parent" => "bigint(21) DEFAULT '0' NOT NULL",
178 "titre" => "text NOT NULL",
179 "descriptif" => "text NOT NULL",
180 "texte" => "longblob NOT NULL",
181 "id_secteur" => "bigint(21) DEFAULT '0' NOT NULL",
182 "maj" => "TIMESTAMP",
183 "export" => "VARCHAR(10) DEFAULT 'oui'",
184 "id_import" => "BIGINT DEFAULT '0'",
185 "statut" => "VARCHAR(10) NOT NULL",
186 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
187 "lang" => "VARCHAR(10) DEFAULT '' NOT NULL",
188 "langue_choisie" => "VARCHAR(3) DEFAULT 'non'",
189 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
190 "extra" => "longblob NULL",
191 "url_propre" => "VARCHAR(255) NOT NULL",
192 "statut_tmp" => "VARCHAR(10) NOT NULL",
193 "date_tmp" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL"
194 );
195
196 $spip_rubriques_key = array(
197 "PRIMARY KEY" => "id_rubrique",
198 "KEY lang" => "lang",
199 "KEY idx" => "idx",
200 "KEY id_parent" => "id_parent",
201 "KEY url_propre" => "url_propre");
202
203 $spip_documents = array(
204 "id_document" => "bigint(21) NOT NULL",
205 "id_vignette" => "bigint(21) DEFAULT '0' NOT NULL",
206 "id_type" => "bigint(21) DEFAULT '0' NOT NULL",
207 "titre" => "text NOT NULL",
208 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
209 "descriptif" => "text NOT NULL",
210 "fichier" => "varchar(255) NOT NULL",
211 "taille" => "integer NOT NULL",
212 "largeur" => "integer NOT NULL",
213 "hauteur" => "integer NOT NULL",
214 "mode" => "ENUM('vignette', 'document') NOT NULL",
215 "inclus" => "VARCHAR(3) DEFAULT 'non'",
216 "distant" => "VARCHAR(3) DEFAULT 'non'",
217 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
218 "maj" => "TIMESTAMP");
219
220 $spip_documents_key = array(
221 "PRIMARY KEY" => "id_document",
222 "KEY id_vignette" => "id_vignette",
223 "KEY mode" => "mode",
224 "KEY id_type" => "id_type");
225
226 $spip_types_documents = array(
227 "id_type" => "bigint(21) NOT NULL",
228 "titre" => "text NOT NULL",
229 "descriptif" => "text NOT NULL",
230 "extension" => "varchar(10) NOT NULL",
231 "mime_type" => "varchar(100) NOT NULL",
232 "inclus" => "ENUM('non', 'image', 'embed') NOT NULL DEFAULT 'non'",
233 "upload" => "ENUM('oui', 'non') NOT NULL DEFAULT 'oui'",
234 "maj" => "TIMESTAMP");
235
236 $spip_types_documents_key = array(
237 "PRIMARY KEY" => "id_type",
238 "UNIQUE extension" => "extension",
239 "KEY inclus" => "inclus");
240
241 $spip_syndic = array(
242 "id_syndic" => "bigint(21) NOT NULL",
243 "id_rubrique" => "bigint(21) DEFAULT '0' NOT NULL",
244 "id_secteur" => "bigint(21) DEFAULT '0' NOT NULL",
245 "nom_site" => "blob NOT NULL",
246 "url_site" => "blob NOT NULL",
247 "url_syndic" => "blob NOT NULL",
248 "descriptif" => "blob NOT NULL",
249 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
250 "maj" => "TIMESTAMP",
251 "syndication" => "VARCHAR(3) NOT NULL",
252 "statut" => "VARCHAR(10) NOT NULL",
253 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
254 "date_syndic" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
255 "date_index" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
256 "extra" => "longblob NULL",
257 "moderation" => "VARCHAR(3) DEFAULT 'non'",
258 "miroir" => "VARCHAR(3) DEFAULT 'non'",
259 "oubli" => "VARCHAR(3) DEFAULT 'non'"
260 );
261
262 $spip_syndic_key = array(
263 "PRIMARY KEY" => "id_syndic",
264 "KEY id_rubrique" => "id_rubrique",
265 "KEY id_secteur" => "id_secteur",
266 "KEY idx" => "idx",
267 "KEY statut" => "statut, date_syndic");
268
269 $spip_syndic_articles = array(
270 "id_syndic_article" => "bigint(21) NOT NULL",
271 "id_syndic" => "bigint(21) DEFAULT '0' NOT NULL",
272 "titre" => "text NOT NULL",
273 "url" => "VARCHAR(255) NOT NULL",
274 "date" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
275 "lesauteurs" => "text NOT NULL",
276 "maj" => "TIMESTAMP",
277 "statut" => "VARCHAR(10) NOT NULL",
278 "descriptif" => "blob NOT NULL");
279
280 $spip_syndic_articles_key = array(
281 "PRIMARY KEY" => "id_syndic_article",
282 "KEY id_syndic" => "id_syndic",
283 "KEY statut" => "statut",
284 "KEY url" => "url");
285
286 $spip_forum = array(
287 "id_forum" => "bigint(21) NOT NULL",
288 "id_parent" => "bigint(21) DEFAULT '0' NOT NULL",
289 "id_thread" => "bigint(21) DEFAULT '0' NOT NULL",
290 "id_rubrique" => "bigint(21) DEFAULT '0' NOT NULL",
291 "id_article" => "bigint(21) DEFAULT '0' NOT NULL",
292 "id_breve" => "bigint(21) DEFAULT '0' NOT NULL",
293 "date_heure" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
294 "titre" => "text NOT NULL",
295 "texte" => "mediumtext NOT NULL",
296 "auteur" => "text NOT NULL",
297 "email_auteur" => "text NOT NULL",
298 "nom_site" => "text NOT NULL",
299 "url_site" => "text NOT NULL",
300 "statut" => "varchar(8) NOT NULL",
301 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
302 "ip" => "varchar(16)",
303 "maj" => "TIMESTAMP",
304 "id_auteur" => "BIGINT DEFAULT '0' NOT NULL",
305 "id_message" => "bigint(21) DEFAULT '0' NOT NULL",
306 "id_syndic" => "bigint(21) DEFAULT '0' NOT NULL");
307
308 $spip_forum_key = array(
309 "PRIMARY KEY" => "id_forum",
310 "KEY id_parent" => "id_parent",
311 "KEY id_rubrique" => "id_rubrique",
312 "KEY id_article" => "id_article",
313 "KEY id_breve" => "id_breve",
314 "KEY id_message" => "id_message",
315 "KEY id_syndic" => "id_syndic",
316 "KEY idx" => "idx",
317 "KEY statut" => "statut, date_heure");
318
319 $spip_signatures = array(
320 "id_signature" => "bigint(21) NOT NULL",
321 "id_article" => "bigint(21) DEFAULT '0' NOT NULL",
322 "date_time" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
323 "nom_email" => "text NOT NULL",
324 "ad_email" => "text NOT NULL",
325 "nom_site" => "text NOT NULL",
326 "url_site" => "text NOT NULL",
327 "message" => "mediumtext NOT NULL",
328 "statut" => "varchar(10) NOT NULL",
329 "idx" => "ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL",
330 "maj" => "TIMESTAMP");
331
332 $spip_signatures_key = array(
333 "PRIMARY KEY" => "id_signature",
334 "KEY id_article" => "id_article",
335 "KEY idx" => "idx",
336 "KEY statut" => "statut");
337
338 global $tables_principales;
339
340 /// Attention: mes_fonctions peut avoir deja defini cette variable
341 /// il faut donc rajouter, mais pas reinitialiser
342
343 $tables_principales['spip_articles'] =
344 array('field' => &$spip_articles, 'key' => &$spip_articles_key);
345 $tables_principales['spip_auteurs'] =
346 array('field' => &$spip_auteurs, 'key' => &$spip_auteurs_key);
347 $tables_principales['spip_breves'] =
348 array('field' => &$spip_breves, 'key' => &$spip_breves_key);
349 $tables_principales['spip_messages'] =
350 array('field' => &$spip_messages, 'key' => &$spip_messages_key);
351 $tables_principales['spip_mots'] =
352 array('field' => &$spip_mots, 'key' => &$spip_mots_key);
353 $tables_principales['spip_groupes_mots'] =
354 array('field' => &$spip_groupes_mots, 'key' => &$spip_groupes_mots_key);
355 $tables_principales['spip_rubriques'] =
356 array('field' => &$spip_rubriques, 'key' => &$spip_rubriques_key);
357 $tables_principales['spip_documents'] =
358 array('field' => &$spip_documents, 'key' => &$spip_documents_key);
359 $tables_principales['spip_types_documents'] =
360 array('field' => &$spip_types_documents, 'key' => &$spip_types_documents_key);
361 $tables_principales['spip_syndic'] =
362 array('field' => &$spip_syndic, 'key' => &$spip_syndic_key);
363 $tables_principales['spip_syndic_articles'] =
364 array('field' => &$spip_syndic_articles, 'key' => &$spip_syndic_articles_key);
365 $tables_principales['spip_forum'] =
366 array('field' => &$spip_forum, 'key' => &$spip_forum_key);
367 $tables_principales['spip_signatures'] =
368 array('field' => &$spip_signatures, 'key' => &$spip_signatures_key);
369
370 ?>