summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2021-05-11 09:42:07 +0200
committerIrina Gómez <irinagomez@us.es>2021-05-11 09:42:07 +0200
commitf672c5e22bb308527ca1e1c889d95d41348f5f91 (patch)
treeedbdc935781635bdc6b7d9653db40f1f3c2ee331 /installer
parentd9397d8a4a477772c10e6f4abc844ca329d2b6c1 (diff)
#1046 Import script
Fixes the error when there is a record with the string 'usuario' in the original database. The SQL statement includes a stricter condition when modifying the 'usuario' table.
Diffstat (limited to 'installer')
-rwxr-xr-xinstaller/opengnsys_import.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/installer/opengnsys_import.sh b/installer/opengnsys_import.sh
index d49c3312..5f79f04e 100755
--- a/installer/opengnsys_import.sh
+++ b/installer/opengnsys_import.sh
@@ -361,7 +361,7 @@ fi
sed -i -e '/Table structure.* `entornos`/,/Table structure/d' \
-e '/Table structure.*`usuarios`/,/CHARSET/d' \
-e '/usuarios/s/IGNORE//g' \
- -e '/usuarios/s/^INSERT /\nALTER TABLE usuarios ADD UNIQUE (usuario);\n\nINSERT IGNORE /g' \
+ -e '/usuarios/s/^INSERT INTO .usuarios. /\nALTER TABLE usuarios ADD UNIQUE (usuario);\n\nINSERT IGNORE INTO `usuarios` /g' \
-e "s/\(DEFINER=\`\)[^\`]*\(\`.* TRIGGER\)/\1$USUARIO\2/" \
-e "s/\(\` [a-z]*int([0-9]*) NOT NULL\),/\1 DEFAULT 0,/" \
-e "s/\(\` [a-z]*char([0-9]*) NOT NULL\),/\1 DEFAULT '',/" \