-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed.sh
More file actions
executable file
·35 lines (30 loc) · 1.15 KB
/
seed.sh
File metadata and controls
executable file
·35 lines (30 loc) · 1.15 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
#!/bin/bash
# Define colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${YELLOW}🌱 Starting Database Seeding Process...${NC}"
echo -e "${YELLOW}⚠️ WARNING: This will RESET the database and drop all existing data!${NC}"
echo "Waiting for 3 seconds before starting... (Press Ctrl+C to cancel)"
sleep 3
# Check if docker-compose is running
if ! docker-compose ps | grep "Up" > /dev/null; then
echo -e "${RED}❌ Error: Docker containers are not running.${NC}"
echo "Please run 'docker-compose up -d' first."
exit 1
fi
echo -e "🚀 Executing seed script inside backend container..."
# Execute the seed command
if docker-compose exec backend python3 -m backend.seed; then
echo -e "${GREEN}✅ Database seeding completed successfully!${NC}"
echo ""
echo -e "${BLUE}📝 Default Login Credentials:${NC}"
echo -e " Admin: username: admin password: iiitsux123"
echo -e " Student: username: student password: student123"
echo -e " Faculty: username: faculty password: faculty123"
else
echo -e "${RED}❌ Database seeding failed.${NC}"
exit 1
fi