Reputation: 1009
I get the following output when I run makemigrations and then migrate:
(roundwellenv) ruben@ruben-H81M-D2V:~/roundwell$ ./dev_migrations.sh
No changes detected in apps 'contenttypes', 'parents', 'admin', 'tips', 'tutors', 'login', 'auth', 'quiz', 'sessions'
Operations to perform:
Apply all migrations: admin, auth, contenttypes, login, parents, quiz, sessions, tips, tutors
Running migrations:
Applying contenttypes.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0001_initial... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying auth.0010_alter_group_name_max_length... OK
Applying auth.0011_update_proxy_permissions... OK
Applying login.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying parents.0001_initial... OK
Applying quiz.0001_initial... OK
Applying sessions.0001_initial... OK
Applying tips.0001_initial... OK
Applying tutors.0001_initial... OK
(roundwellenv) ruben@ruben-H81M-D2V:~/roundwell$ python manage.py createsuperuser
You have 21 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, login, parents, quiz, sessions, tips, tutors.
Run 'python manage.py migrate' to apply them.
I know something is really wrong because even if I delete pycache content and the conent from migration folders and a clean sqlite3 db it actually doesn't find any migrations it needs to apply unless I specify the apps I would like to create migrations for. Any clue as to what could be causing this? I suspect it might be my custom login app, but once the migrations are done (like they are on the system here the site is actually run) the DB works fine.
Upvotes: 1
Views: 424
Reputation: 16002
Try running the following, while in your project folder:
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
Then delete your sqlite DB, and try the migrations again.
Make sure you are in your project folder, or else this command will break your Django download!
Upvotes: 1