-
Notifications
You must be signed in to change notification settings - Fork 20
DB Migration alembic
Please create your DB with utf8mb4 charset ! If not, you can have some unicode errors when a name contains accents or smileys :
CREATE DATABASE monkey CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
DB migration is handled with alembic python3 scripts/create_db.py is deprecated in Monocle/Monkey
To perform DB schema migration to latest version, run
alembic upgrade head
For some reason, if you need to run raw SQL for migration, run the dry-run. It will display all the DB migration SQL.
alembic upgrade head --sql
Make sure alembic is installed
via pip3[.6] install -r requirements.txt -U
.
Alembic executables is located in the same folder as python3
, pip3[.6]
, etc commands. So if you usually run python with virtual environment, you would need to find alembic in the same directory.
E.g. If your pip3[.6] is in /opt/python/bin/pip3[.6]
, your alembic would also be in /opt/python/bin/alembic
. Tou can then run alembic like the following
/opt/python/bin/alembic updgrade head --sql