南に追加したばかりの既存のDjangoプロジェクトがありました。
- syncdbをローカルで実行しました。
- 私は
manage.py schemamigration app_name
地元で走った - 私は
manage.py migrate app_name --fake
地元で走った - コミットしてherokuマスターにプッシュします
- herokuでsyncdbを実行しました
manage.py schemamigration app_name
Herokuで実行しましたmanage.py migrate app_name
Herokuで実行しました
私はそれからこれを受け取ります:
$ heroku run python notecard/manage.py migrate notecards
Running python notecard/manage.py migrate notecards attached to terminal... up, run.1
Running migrations for notecards:
- Migrating forwards to 0005_initial.
> notecards:0003_initial
Traceback (most recent call last):
File "notecard/manage.py", line 14, in <module>
execute_manager(settings)
File "/app/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/app/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/app/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle
ignore_ghosts = ignore_ghosts,
File "/app/lib/python2.7/site-packages/south/migration/__init__.py", line 191, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many
result = self.migrate(migration, database)
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate
result = self.run(migration)
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run
return self.run_migration(migration)
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 81, in run_migration
migration_function()
File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 57, in <lambda>
return (lambda: direction(orm))
File "/app/notecard/notecards/migrations/0003_initial.py", line 15, in forwards
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
File "/app/lib/python2.7/site-packages/south/db/generic.py", line 226, in create_table
', '.join([col for col in columns if col]),
File "/app/lib/python2.7/site-packages/south/db/generic.py", line 150, in execute
cursor.execute(sql, params)
File "/app/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/app/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: relation "notecards_semester" already exists
私は3つのモデルを持っています。セクション、学期、およびノートカード。Notecardsモデルに1つのフィールドを追加しましたが、Herokuに追加できません。
ありがとうございました。