-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_enrollment_migration.sh
More file actions
executable file
Β·44 lines (36 loc) Β· 1.32 KB
/
Copy pathdeploy_enrollment_migration.sh
File metadata and controls
executable file
Β·44 lines (36 loc) Β· 1.32 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
#!/bin/bash
# Deployment script for enrollment codes migration
# This should be run on the server where the backend is deployed
echo "π Starting enrollment codes migration deployment..."
# Check if we're in the right directory
if [ ! -f "migrate_enrollment_codes.py" ]; then
echo "β Migration script not found. Make sure you're in the correct directory."
exit 1
fi
# Activate virtual environment if it exists
if [ -d "venv" ]; then
echo "π¦ Activating virtual environment..."
source v/bin/activate
elif [ -d "../v" ]; then
echo "π¦ Activating virtual environment..."
source ../v/bin/activate
fi
# Install dependencies if needed
echo "π¦ Installing/updating dependencies..."
pip install -r backend/backend/requirements.txt
# Run the migration
echo "ποΈ Running enrollment codes migration..."
python3 migrate_enrollment_codes.py
# Check if migration was successful
if [ $? -eq 0 ]; then
echo "β
Enrollment codes migration completed successfully!"
echo "π The enrollment code system is now ready to use!"
else
echo "β Migration failed. Please check the error messages above."
exit 1
fi
echo "π Migration Summary:"
echo " - Created enrollment_codes table"
echo " - Added indexes for performance"
echo " - Created update trigger"
echo " - Ready for enrollment code generation"