Project

General

Profile

Anomalie #678

Galette v0.7.5. Mise à jour des tables défectueuse.

Added by Roland Telle over 6 years ago. Updated over 6 years ago.

Status:
Fermé
Priority:
Haut
Category:
Base de données
Target version:
-
Start date:
08/18/2013
Due date:
% Done:

100%

Estimated time:
Version utilisée:
Vote:

Description

Lors d'une mise à jour de Galette v0.7.4.2 vers Galettev0.7.5, l'anomalie suivante se déclenche (Création/Mise à jour des tables) :

ALTER TABLE galette_tmppasswds ...SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT galette_tmppasswds_ibfk_1, ADD CONSTRAINT galette_tmppasswds_ibfk_1' at line 2
(ALTER TABLE galette_tmppasswds DROP CONSTRAINT galette_tmppasswds_ibfk_1, ADD CONSTRAINT galette_tmppasswds_ibfk_1 FOREIGN KEY (id_adh) REFERENCES galette_adherents ON DELETE CASCADE)


Related issues

Has duplicate Galette - Anomalie #684: erreur de syntaxeRejeté08/26/2013

Actions

Associated revisions

Revision 9349b19d (diff)
Added by Johan Cwiklinski over 6 years ago

MySQL upgrade script issue; fixes #678

History

#1

Updated by Roland Telle over 6 years ago

Le correctif proposé dans le message https://mail.gna.org/public/galette-discussion/2013-08/msg00024.html fonctionne parfaitement. Merci ;-)

#2

Updated by Johan Cwiklinski over 6 years ago

  • Status changed from Nouveau to In Progress
  • Assignee set to Johan Cwiklinski
  • Category set to Base de données

Le correctif :

diff --git a/galette/install/sql/upgrade-to-0.75-mysql.sql b/galette/install/sql/upgrade-to-0.75-mysql.sql
index 28389dd..b95f24f 100644
--- a/galette/install/sql/upgrade-to-0.75-mysql.sql
+++ b/galette/install/sql/upgrade-to-0.75-mysql.sql
@@ -27,9 +27,9 @@ CREATE TABLE galette_pdfmodels (
   PRIMARY KEY (model_id)
 ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

+ALTER TABLE galette_tmppasswds DROP FOREIGN KEY galette_tmppasswds_ibfk_1;
 ALTER TABLE galette_tmppasswds
-  DROP CONSTRAINT galette_tmppasswds_ibfk_1,
   ADD CONSTRAINT galette_tmppasswds_ibfk_1
-    FOREIGN KEY (id_adh) REFERENCES galette_adherents ON DELETE CASCADE;
+    FOREIGN KEY (id_adh) REFERENCES galette_adherents (id_adh) ON DELETE CASCADE ON UPDATE RESTRICT ;

 UPDATE galette_database SET version = 0.703;
#3

Updated by Johan Cwiklinski over 6 years ago

  • Status changed from In Progress to Résolu
  • % Done changed from 0 to 100
#4

Updated by Johan Cwiklinski over 6 years ago

  • Status changed from Résolu to Fermé

Also available in: Atom PDF