Last active
October 26, 2022 22:12
-
-
Save eupharis/398584dfb5935fede446caa8adec61bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./manage.py shell_plus | |
# If you only have ONE database | |
from django.db import connection | |
from django.db.migrations.recorder import MigrationRecorder | |
from django.utils import timezone | |
recorder=MigrationRecorder(connection) | |
recorder.record_applied(app=app_name, name=migration_name) | |
# for multiple databases, for some reason, even if you specify the connection it doesn't work | |
# so just do it in sql | |
./manage.py dbshell --database=dbname | |
INSERT into "django_migrations" (app,name,applied) VALUES ($LABEL, $APP_NAME, current_timestamp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment