summaryrefslogtreecommitdiff
path: root/bin/cezar-db-import.sh
blob: 4db5261eaad5561ce11cff683387639bad3c7919 (plain)
1
2
3
4
5
6
7
8
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]}