-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_validation.sh
More file actions
executable file
Β·45 lines (37 loc) Β· 1.43 KB
/
run_validation.sh
File metadata and controls
executable file
Β·45 lines (37 loc) Β· 1.43 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
#!/bin/bash
# =========================
# Enum λ°μ΄ν° κ²μ¦ μ€ν¬λ¦½νΈ
# =========================
echo "=========================================="
echo "Enum λ°μ΄ν° κ²μ¦ μμ"
echo "=========================================="
echo ""
# μ¬μ©μμκ² νκ²½ μ ν
read -p "κ²μ¦ν νκ²½μ μ ννμΈμ (dev/prod): " ENV
if [ "$ENV" != "dev" ] && [ "$ENV" != "prod" ]; then
echo "μ€λ₯: 'dev' λλ 'prod'λ§ μ
λ ₯ κ°λ₯ν©λλ€."
exit 1
fi
# DB μ μ μ 보 μ
λ ₯
read -p "DB νΈμ€νΈλ₯Ό μ
λ ₯νμΈμ: " DB_HOST
read -p "DB μ¬μ©μλͺ
μ μ
λ ₯νμΈμ: " DB_USER
read -sp "DB λΉλ°λ²νΈλ₯Ό μ
λ ₯νμΈμ: " DB_PASS
echo ""
read -p "DB μ΄λ¦μ μ
λ ₯νμΈμ: " DB_NAME
echo ""
echo "[$ENV νκ²½] λ°μ΄ν° κ²μ¦μ μμν©λλ€..."
echo ""
# κ²μ¦ 쿼리 μ€ν
RESULT_FILE="validation_result_${ENV}_$(date +%Y%m%d_%H%M%S).txt"
mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" < validate_enum_data.sql > "$RESULT_FILE" 2>&1
if [ $? -eq 0 ]; then
echo "β
κ²μ¦ μλ£! κ²°κ³Ό νμΌμ νμΈνμΈμ: $RESULT_FILE"
echo ""
echo "β οΈ μ€μ: κ²°κ³Ό νμΌμμ μλ λ΄μ©μ νμΈνμΈμ"
echo " - λΆμΌμΉ λ°μ΄ν°κ° μλ κ²½μ°: λ°μ΄ν° μ 리 ν λ€μ κ²μ¦"
echo " - κ²°κ³Όκ° λΉμ΄μλ κ²½μ°: varchar β enum λ³ν μ§ν κ°λ₯"
echo ""
else
echo "β κ²μ¦ μ€ν¨. μ μ μ 보λ₯Ό νμΈνμΈμ."
exit 1
fi