haikal/apply_initial_migrations.sh
2025-09-01 09:02:27 +03:00

25 lines
592 B
Bash
Executable File

#!/bin/sh
echo "Delete Old Migrations"
find ./inventory -type f -iname "00*.py" -delete
find ./haikalbot -type f -iname "00*.py" -delete
echo "Delete Old Cache"
find ./car_inventory -type d -iname "__pycache__"|xargs rm -rf
find ./inventory -type d -iname "__pycache__"|xargs rm -rf
find ./haikalbot -type d -iname "__pycache__"|xargs rm -rf
echo "Apply Base Migrate"
python3 manage.py migrate
echo "Apply makemigrations"
python3 manage.py makemigrations
echo "Apply Final Migrate"
python3 manage.py migrate
echo "Collect Static"
python3 manage.py collectstatic --no-input
echo "Done"