/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
- * Copyright (c) 2001-2014 *
+ * Copyright (c) 2001-2017 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/
-if (!defined('_ECRIRE_INC_VERSION')) return;
+/**
+ * Gestion des mises à jour de SPIP, versions 1.7*
+ *
+ * @package SPIP\Core\SQL\Upgrade
+ **/
+if (!defined('_ECRIRE_INC_VERSION')) {
+ return;
+}
-function maj_v017_dist($version_installee, $version_cible)
-{
+/**
+ * Mises à jour de SPIP n°017
+ *
+ * @param float $version_installee Version actuelle
+ * @param float $version_cible Version de destination
+ **/
+function maj_v017_dist($version_installee, $version_cible) {
if (upgrade_vers(1.702, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD extra longblob NULL");
spip_query("ALTER TABLE spip_auteurs ADD extra longblob NULL");
spip_query("UPDATE spip_mots SET extra = supplement");
spip_query("ALTER TABLE spip_mots DROP supplement");
}
-
+
$u = spip_query("SELECT extra FROM spip_articles");
- $u&= spip_query("SELECT extra FROM spip_auteurs");
- $u&= spip_query("SELECT extra FROM spip_breves");
- $u&= spip_query("SELECT extra FROM spip_rubriques");
- $u&= spip_query("SELECT extra FROM spip_mots");
- maj_version (1.702,$u);
+ $u &= spip_query("SELECT extra FROM spip_auteurs");
+ $u &= spip_query("SELECT extra FROM spip_breves");
+ $u &= spip_query("SELECT extra FROM spip_rubriques");
+ $u &= spip_query("SELECT extra FROM spip_mots");
+ maj_version(1.702, $u);
}
if (upgrade_vers(1.703, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD lang VARCHAR(10) DEFAULT '' NOT NULL");
spip_query("ALTER TABLE spip_rubriques ADD lang VARCHAR(10) DEFAULT '' NOT NULL");
- maj_version (1.703);
+ maj_version(1.703);
}
if (upgrade_vers(1.704, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD INDEX lang (lang)");
spip_query("ALTER TABLE spip_auteurs ADD INDEX lang (lang)");
spip_query("ALTER TABLE spip_rubriques ADD INDEX lang (lang)");
- maj_version (1.704);
+ maj_version(1.704);
}
if (upgrade_vers(1.705, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD langue_choisie VARCHAR(3) DEFAULT 'non'");
spip_query("ALTER TABLE spip_rubriques ADD langue_choisie VARCHAR(3) DEFAULT 'non'");
- maj_version (1.705);
+ maj_version(1.705);
}
if (upgrade_vers(1.707, $version_installee, $version_cible)) {
spip_query("UPDATE spip_articles SET lang=MID(lang,2,8) WHERE langue_choisie = 'non'");
spip_query("UPDATE spip_rubriques SET langue_choisie='oui' WHERE MID(lang,1,1) != '.' AND lang != ''");
spip_query("UPDATE spip_rubriques SET lang=MID(lang,2,8) WHERE langue_choisie = 'non'");
- maj_version (1.707);
+ maj_version(1.707);
}
if (upgrade_vers(1.708, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_breves ADD lang VARCHAR(10) DEFAULT '' NOT NULL");
spip_query("ALTER TABLE spip_breves ADD langue_choisie VARCHAR(3) DEFAULT 'non'");
- maj_version (1.708);
+ maj_version(1.708);
}
if (upgrade_vers(1.709, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD id_trad bigint(21) DEFAULT '0' NOT NULL");
spip_query("ALTER TABLE spip_articles ADD INDEX id_trad (id_trad)");
- maj_version (1.709);
+ maj_version(1.709);
}
if (upgrade_vers(1.717, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD INDEX date_modif (date_modif)");
- maj_version (1.717);
+ maj_version(1.717);
}
if (upgrade_vers(1.718, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_referers DROP domaine");
spip_query("ALTER TABLE spip_referers_articles DROP domaine");
spip_query("ALTER TABLE spip_referers_temp DROP domaine");
- maj_version (1.718);
+ maj_version(1.718);
}
if (upgrade_vers(1.722, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles DROP INDEX url_ref");
spip_query("ALTER TABLE spip_articles DROP url_ref");
}
- maj_version (1.722);
+ maj_version(1.722);
}
if (upgrade_vers(1.723, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles DROP INDEX url_site;");
spip_query("ALTER TABLE spip_articles ADD INDEX url_site (url_site);");
}
- maj_version (1.723);
+ maj_version(1.723);
}
if (upgrade_vers(1.724, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_messages ADD date_fin datetime DEFAULT '0000-00-00 00:00:00' NOT NULL");
- maj_version (1.724);
+ maj_version(1.724);
}
if (upgrade_vers(1.726, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_auteurs ADD low_sec tinytext NOT NULL");
- maj_version (1.726);
+ maj_version(1.726);
}
if (upgrade_vers(1.727, $version_installee, $version_cible)) {
spip_query("UPDATE spip_rubriques SET lang=REPLACE(lang,'oci_', 'oc_') WHERE lang LIKE 'oci_%'");
spip_query("UPDATE spip_articles SET lang=REPLACE(lang,'oci_', 'oc_') WHERE lang LIKE 'oci_%'");
spip_query("UPDATE spip_breves SET lang=REPLACE(lang,'oci_', 'oc_') WHERE lang LIKE 'oci_%'");
- maj_version (1.727);
+ maj_version(1.727);
}
// Ici version 1.7 officielle
if (upgrade_vers(1.728, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_articles ADD id_version int unsigned DEFAULT '0' NOT NULL");
- maj_version (1.728);
+ maj_version(1.728);
}
if (upgrade_vers(1.730, $version_installee, $version_cible)) {
spip_query("ALTER TABLE spip_forum ADD INDEX idx (idx)");
spip_query("ALTER TABLE spip_signatures ADD idx ENUM('', '1', 'non', 'oui', 'idx') DEFAULT '' NOT NULL");
spip_query("ALTER TABLE spip_signatures ADD INDEX idx (idx)");
- maj_version (1.730);
+ maj_version(1.730);
}
if (upgrade_vers(1.731, $version_installee, $version_cible)) {
spip_query("UPDATE spip_rubriques SET idx='1' where lang IN ('de','vi')");
spip_query("UPDATE spip_breves SET idx='1' where lang IN ('de','vi')");
spip_query("UPDATE spip_auteurs SET idx='1' where lang IN ('de','vi')");
- maj_version (1.731);
+ maj_version(1.731);
}
- if (upgrade_vers(1.732, $version_installee, $version_cible)) { // en correction d'un vieux truc qui avait fait sauter le champ inclus sur les bases version 1.415
+ if (upgrade_vers(1.732, $version_installee,
+ $version_cible)) { // en correction d'un vieux truc qui avait fait sauter le champ inclus sur les bases version 1.415
spip_query("ALTER TABLE spip_documents ADD inclus VARCHAR(3) DEFAULT 'non'");
- maj_version (1.732);
+ maj_version(1.732);
}
if (upgrade_vers(1.733, $version_installee, $version_cible)) {
# maj_version(1.734);
#}
}
-
-
-?>