summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinstaller/opengnsys_import.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/installer/opengnsys_import.sh b/installer/opengnsys_import.sh
index 4ac296d1..0acfee8d 100755
--- a/installer/opengnsys_import.sh
+++ b/installer/opengnsys_import.sh
@@ -173,11 +173,12 @@ function updateSqlFile()
mysql --defaults-extra-file=$MYCNF -D "$AUXCATALOG" -e \
"$(mysql --defaults-extra-file=$MYCNF -Nse "
SELECT CASE WHEN DATA_TYPE LIKE '%int' THEN
- CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'ALTER', COLUMN_NAME, 'SET DEFAULT 0;')
- WHEN DATA_TYPE LIKE '%char' THEN
- CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'ALTER', COLUMN_NAME, 'SET DEFAULT \'\';')
- WHEN DATA_TYPE = 'text' THEN
- CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'MODIFY', COLUMN_NAME, 'TEXT NOT NULL;')
+ CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'ALTER', COLUMN_NAME, 'SET DEFAULT 0;')
+ WHEN DATA_TYPE LIKE '%char' THEN
+ CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'ALTER', COLUMN_NAME, 'SET DEFAULT \'\';')
+ WHEN DATA_TYPE = 'text' THEN
+ CONCAT_WS(' ', 'ALTER TABLE', TABLE_NAME, 'MODIFY', COLUMN_NAME, 'TEXT NOT NULL;')
+ ELSE ''
END
FROM information_schema.columns
WHERE TABLE_SCHEMA='$AUXCATALOG'