Skip to content

Database Migration for MySQL

stmtstk edited this page Jul 22, 2020 · 2 revisions

If you would like to custom S-TIP, feel like to change the sources.

However if changed any models.py files (i.e. changed Database Filed Length) and/or changed const values, you have to run a migrate command python manage.py makemigrations.

Before you run python manage.py, you will have to set PYTHONPATH value. If you have installed S-TIP through this this way, you should set PYTHONPATH value below.

export PYTHONPATH=/opt/s-tip/common/src:/opt/s-tip/rs/src:/opt/s-tip/sns/src:/opt/s-tip/gv/src

After that, move to bin directory (i.e. /opt/s-tip/sns/bin) run python manage.py. If manage.py usage appears, you can set PYTHONPATH successfully. If error messages appear, you should resolve why the error occurred (maybe you use another python instance).

python manage.py makemigrations
python manage.py migrate

makemigrations command generates migration files under each migrations directory. migrate command execute to change MySQL Database schema.

Clone this wiki locally