Project

General

Profile

Actions

Anomalie #678

closed

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

Added by Roland Telle about 11 years ago. Updated about 11 years ago.

Status:
Fermé
Priority:
Haut
Category:
Database
Target version:
-
Start date:
08/18/2013
Due date:
% Done:

100%

Estimated time:
Version utilisée:

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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Roland Telle about 11 years ago

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

Actions #2

Updated by Johan Cwiklinski about 11 years ago

  • Status changed from Nouveau to In Progress
  • Assignee set to Johan Cwiklinski
  • Category set to Database

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;
Actions #3

Updated by Johan Cwiklinski about 11 years ago

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

Updated by Johan Cwiklinski about 11 years ago

  • Status changed from Résolu to Fermé
Actions

Also available in: Atom PDF