Hello,
I am stuck to a problem that I dont understand at step insert_data.sh :
I ve that code bellow in my insert_data.sh :
cat games.csv | while IFS="," read -r YEAR ROUND WINNER OPPONENT WINNER_GOALS OPPONENT_GOALS
do
if [[ $WINNER != "winner" ]]
then
SELECT_WINNER_TEAM=$($PSQL "SELECT name FROM teams WHERE name='$WINNER'")
if [[ -z $SELECT_WINNER_TEAM ]]
then
ADD_WINNER=$($PSQL "INSERT INTO teams(name) VALUES('$WINNER')")
echo $ADD_WINNER
fi
SELECT_OPPONENT_TEAM=$($PSQL "SELECT * FROM teams WHERE name='$OPPONENT'")
if [[ -z $SELECT_OPPONENT_TEAM ]]
then
ADD_OPPONENT=$($PSQL "INSERT INTO teams(name) VALUES('$OPPONENT')")
echo $ADD_OPPONENT
fi
fi
done
fi
I dont get any error in the terminal and I got the 24 rows but I keep having this message :
" When you run your insert_data.sh
script, it should add each unique team to the teams
table. There should be 24 rows"
All the others steps before are marked as green, I have already did a refresh and I have also deleted the container in codeally but the error is still there.
Anyone has a solution ?
Thank you