Commit babd35f4 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

Use auto-generated migrations (instead of storing them in the git repo)


This commit will have to be reverted when we go to production
parent 8e095066
# Do not store any migration in the repository for the moment
# (to be removed when we deploy in production)
/allgo/main/migrations/*.py
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
......
......@@ -23,6 +23,12 @@ fi
# create the database
echo "CREATE DATABASE allgo CHARACTER SET 'utf8';" | mysql_cmd
# generate the missing migrations (in qualif/dev only)
# TODO: remove this when we deploy in production
if [ "$ENV" = dev ] || [ "$ENV" = qualif ] ; then
python3 manage.py makemigrations
fi
# create the tables (apply the migrations)
python3 manage.py migrate
......
......@@ -37,3 +37,7 @@ done)
# create the allgo user
useradd -m -s /bin/bash allgo
# make the migration dir world-writable to allow generating migrations in qualif
# TODO: remove when we deploy in production
chmod 1777 /opt/allgo/allgo/main/migrations
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment