From 7c457ed0b438e929ecc637aed3a21dfde7572e5c Mon Sep 17 00:00:00 2001 From: Garrett Ladley <92384606+garrettladley@users.noreply.github.com> Date: Sun, 21 Jan 2024 21:41:09 -0500 Subject: [PATCH] Update insert_db.sh --- scripts/insert_db.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/scripts/insert_db.sh b/scripts/insert_db.sh index ed7838391..7e3de0655 100755 --- a/scripts/insert_db.sh +++ b/scripts/insert_db.sh @@ -17,18 +17,7 @@ if psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -t -c "$CHECK_TA echo "Database $PGDATABASE exists with tables." else echo "Error: Database $PGDATABASE does not exist or has no tables. Running database migration." - sleep 3 - - # Find the process running on port 8080 and kill it - PROCESS_ID=$(lsof -i :8080 | awk 'NR==2{print $2}') - if [ -n "$PROCESS_ID" ]; then - kill -INT $PROCESS_ID - echo "Killed process $PROCESS_ID running on port 8080." - else - echo "No process running on port 8080." - exit 0 - fi -fi + go run ../backend/src/main.go --only-migrate # Insert data from data.sql if psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -a -f "$INSERTSQL" > /dev/null 2>&1; then @@ -36,4 +25,4 @@ if psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -a -f "$INSERTSQ else echo "Error: Failed to insert data." exit 1 -fi \ No newline at end of file +fi