Closed ritvikgautam closed 7 years ago
@harman28 I've made some changes.
The birth date in the players table is still as varchar. I tried making it to date, but since the csv files has a lot of empty fields for the birth date, mysql throws an error as date fields cannot be "" (it can be null). A possible solution I found was to change all empty fields in the date to null, but I don't want to touch the data now.
@ritvikgautam Would it be possible to create another column called birth_date
, and update that conditionally? i.e. fill it with a date object if date field is present, otherwise store null.
Replace the first few lines with this:
#Set database name
if [ $# -eq 0 ]; then
MYDATABASE="atpdatabase"
elif [ $# -eq 1 ]; then
MYDATABASE=$1
else
echo "Invalid parameters!";
exit 1
fi
#Get MySQL username and password
echo -n "MySQL Username: "
read USERNAME
echo -n "Password: "
read -s PASSWORD
echo
This way password will not need to be typed in plaintext at prompt.
@ritvikgautam Make the password change for now, and do the birth_date change separately. October is coming to an end and you probably want this merged before that.
1