summaryrefslogtreecommitdiff
path: root/bin/cezar-db-import.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cezar-db-import.sh')
-rwxr-xr-xbin/cezar-db-import.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/cezar-db-import.sh b/bin/cezar-db-import.sh
new file mode 100755
index 0000000..4db5261
--- /dev/null
+++ b/bin/cezar-db-import.sh
@@ -0,0 +1,9 @@
+#!/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;
+LOAD DATA LOCAL INFILE '$1'
+REPLACE
+INTO TABLE players
+FIELDS TERMINATED BY ';' ENCLOSED BY '\"';
+SET foreign_key_checks = 1
+" ${DBCONFIG[4]}