Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.7 - App 'your_app_name' does not have migrations

Tags:

I am trying to upgrade from Django 1.6.7 to Django 1.7.1, so I have been trying to migrate my app.

I have followed the django docs here.

I deleted the south from my installed apps.

In the migration directory, I delete the numbered migration files and the .pyc files but I kept the directory & __ init__.py file.

I then run :

python manage.py makemigrations your_app_name

I receive the following confirmation message:

Migrations for 'your_app_name':
  0001_initial.py:
    - Create model UserProfile

Next I run:

python manage.py migrate your_app_name

I received the following error:

CommandError: App 'your_app_name' does not have migrations (you cannot selectively sync unmigrated apps)

As per the docs, I also ran:

python manage.py migrate --fake your_app_name

I received the same error message:

CommandError: App 'your_app_name' does not have migrations (you cannot selectively sync unmigrated apps)

Can anyone shed some light on why this will not work for me?

like image 549
user1261774 Avatar asked Nov 03 '14 05:11

user1261774


People also ask

Where is the migrations folder Django?

admin app is used with your application: the migrations directory for this app is available at site-packages/django/contrib/admin/migrations , but migrations from apps that you created, are all stored inside each app folder.

Is Django migration necessary?

Migrations are not required. They can be useful for creating and tracking database changes via code, but Django applications will run properly without them.


1 Answers

I noticed that only those apps that actually contain a migrations folder that contain a file __init__.py are recognized by migrations. IE having only models.py in your app is not enough.

like image 121
Erwin Kooi Avatar answered Nov 07 '22 07:11

Erwin Kooi