Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django database hung in migration

EDIT: I solved the issue. The problem was that I had a shell open with a database connection to that model. I exited the shell, and everything continued.

I just migrated my database with south, but rather than migrating one app, i accidentally migrated the whole project (./manage.py migrate). Everything went fine until it got to the app that needed the migration. I didnt get an error, but it is hung at that point:

~/django/baeren $ ./manage.py migrate
Running migrations for home:
- Nothing to migrate.
 - Loading initial data for home.
Installed 0 object(s) from 0 fixture(s)
Running migrations for price:
- Nothing to migrate.
 - Loading initial data for price.
Installed 0 object(s) from 0 fixture(s)
Running migrations for gallery:
- Nothing to migrate.
 - Loading initial data for gallery.
Installed 0 object(s) from 0 fixture(s)
Running migrations for menu:
 - Migrating forwards to 0006_auto__add_field_menu_category.
 > menu:0006_auto__add_field_menu_category

The site is still running, and everything is accessible on the admin page except for that specific model. Is it ok to just kill the process and remigrate, or would I be risking something unrecoverable that I don't understand? If the latter, is there an alternative route?

like image 231
skzryzg Avatar asked Jun 28 '13 08:06

skzryzg


1 Answers

I faced the same problem for postgresql database.
After restarting postgresql database, it works fine.

$ sudo service postgresql restart
like image 128
jbacker Avatar answered Oct 18 '22 11:10

jbacker