Skip to content

Commit 19b10cd

Browse files
committed
Fixed cleaning db script
1 parent 39ba85f commit 19b10cd

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

build-scripts/run/cleanup-db-duplicates.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@ WHERE ctid NOT IN (
2121
2222
-- Verify cleanup
2323
SELECT COUNT(*) as total_records FROM EPersonGroup2EPerson;
24-
SELECT COUNT(DISTINCT eperson_group_id, eperson_id) as unique_pairs FROM EPersonGroup2EPerson;
24+
SELECT COUNT(*) as unique_pairs FROM (
25+
SELECT DISTINCT eperson_group_id, eperson_id
26+
FROM EPersonGroup2EPerson
27+
) t;
28+
"
29+
30+
echo "Executing duplicate cleanup..."
31+
docker exec $DDBNAME /bin/bash -c "psql -p 10563 -U dspace -d dspace -c \"$CLEANUP_SQL\""
32+
33+
if [ $? -eq 0 ]; then
34+
echo "Database cleanup completed successfully"
35+
else
36+
echo "Database cleanup failed"
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)