-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathdelete.sh
More file actions
executable file
·54 lines (47 loc) · 1.94 KB
/
delete.sh
File metadata and controls
executable file
·54 lines (47 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
echo "=========================================="
echo "CONSERVATIVE DELETION - 100% SAFE ONLY"
echo "=========================================="
echo ""
DELETED_COUNT=0
# 1. DELETE USER ENTITY
if [ -d "src/main/java/com/open/spring/mvc/user" ]; then
echo "Deleting User entity..."
rm -rf src/main/java/com/open/spring/mvc/user/
((DELETED_COUNT++))
echo " DELETED: User.java, UserApiController.java, UserJpaRepository.java"
fi
# 2. DELETE STUDENT RESPONSE ENTITIES
if [ -f "src/main/java/com/open/spring/mvc/assignments/StudentResponse.java" ]; then
echo "Deleting StudentResponse entities..."
rm -f src/main/java/com/open/spring/mvc/assignments/StudentResponse.java
rm -f src/main/java/com/open/spring/mvc/assignments/StudentResponseController.java
rm -f src/main/java/com/open/spring/mvc/assignments/StudentResponseRepository.java
((DELETED_COUNT++))
echo " DELETED: StudentResponse.java, StudentResponseController.java, StudentResponseRepository.java"
fi
# 3. DELETE STUDENT ENTITY (teamteach)
if [ -f "src/main/java/com/open/spring/mvc/teamteach/Student.java" ]; then
echo "Deleting Student.java from teamteach..."
rm -f src/main/java/com/open/spring/mvc/teamteach/Student.java
((DELETED_COUNT++))
echo " DELETED: teamteach/Student.java"
fi
# 4. DELETE PERSON USER MAPPING
MAPPING_FILES=$(find src/main/java -name "*PersonUserMapping*" 2>/dev/null)
if [ -n "$MAPPING_FILES" ]; then
echo "Deleting PersonUserMapping entities..."
find src/main/java -name "*PersonUserMapping*" -delete
((DELETED_COUNT++))
echo " DELETED: PersonUserMapping files"
fi
echo ""
echo "=========================================="
echo "Entity Cleanup Complete"
echo "Deleted: $DELETED_COUNT entity packages"
echo ""
echo "Next steps:"
echo "1. Verify build: ./mvnw clean compile"
echo "2. Add table drops to ModelInit.java"
echo "3. Test server startup"
echo "=========================================="