Skip to content

Database migrations

Ségolène Albouy edited this page Jul 1, 2026 · 4 revisions

Add manage command to your .bashrc:

echo "alias manage='front/venv/bin/python front/app/manage.py'" >> ~/.bashrc
source ~/.bashrc

List applied migrations

manage showmigrations webapp

SQL on database

manage dbshell

Fake a migration

manage migrate --fake webapp 000X_migration

or

INSERT INTO django_migrations (app, name, applied)
VALUES ('webapp', '000X_migration', now());

Check if field exists

SELECT to_regclass('webapp_model_field');

List databse table

\dt

Clone this wiki locally