diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hidden-import.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/hidden-import.sh b/bin/hidden-import.sh index ecd9f27..6f3104a 100755 --- a/bin/hidden-import.sh +++ b/bin/hidden-import.sh @@ -1,9 +1,10 @@ #!/bin/bash DBCONFIG=($(jq -r '.[]' config/import-db.json)) -mysql -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0; +mysql --local-infile=1 -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0; DELETE FROM hidden_players; LOAD DATA LOCAL INFILE '$1' INTO TABLE hidden_players FIELDS TERMINATED BY ';' ENCLOSED BY '\"'; +UPDATE rankings SET hidden = 1 WHERE pid IN (SELECT pid FROM hidden_players); SET foreign_key_checks = 1 " ${DBCONFIG[4]} |