迁移问题Django + Heroku

时间:2016-12-08 13:29:27

标签: django heroku database-migration

我在heroku上运行了一个django应用程序。我正在尝试使用

进行迁移
heroku run python manage.py migrate 

我首先做了一个makemigrations,正确检测到我的models.py

中的变化

以下是迁移后的错误消息:

    Running python manage.py migrate on ⬢ icontrol... up, run.3314 (Standard-1X)
Operations to perform:
  Synchronize unmigrated apps: suit, suit_redactor, s3direct, corsheaders, suit_sortable
  Apply all migrations: tastypie, sessions, PowertrainExhibit, admin, auth, contenttypes
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying PowertrainExhibit.0004_auto_20161207_1015...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 160, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 63, in migrate
    self.apply_migration(migration, fake=fake)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 97, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/migration.py", line 107, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 139, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 473, in alter_field
    self._alter_field(model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 617, in _alter_field
    sql, params = tuple(zip(*actions))

有什么想法吗?谢谢!

0 个答案:

没有答案