【发布时间】:2015-01-18 20:20:26
【问题描述】:
我一直在我的 heroku 服务器上运行 python manage.py makemigrations,但无论我运行多少次,我都会得到:
$heroku run python manage.py makemigrations
Running `python manage.py makemigrations` attached to terminal... up, run.2680
Migrations for 'default':
0002_auto_20141120_2007.py:
- Alter field user on usersocialauth
如果我运行heroku run python manage.py migrate
它回来了:
Running `python manage.py migrate` attached to terminal... up, run.1285
Operations to perform:
Synchronize unmigrated apps: baflist_core, rest_framework, localflavor, storages
Apply all migrations: admin, userAccount, contenttypes, sessions, default, location, messaging, forum, auth, posts
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
诚然,我对 postgres 和迁移的了解只够危险,所以我想我会在这里问。有没有人遇到过这种情况?
【问题讨论】:
-
您不应该在服务器上运行 makemigrations。本地运行,将创建的迁移文件添加到git,推送,heroku会自动为你运行迁移
标签: django database-migration heroku-postgres django-1.7 django-migrations