私は数ヶ月前にFTPを使用してWebfactionに私のDjango 1.9プロジェクトを配備しました。しかし、私はデプロイメントプロセスの自動化を開始したいので、Webfaction上の既存のデプロイメントをbitbucketレポにリンクすることができました。djangoサーバ1.9での移行が失敗しました
私のローカルのenvはまだ正常に動作していますが、エラーが発生せずに移行できます。しかし、これまでのいくつかのマイグレーションは正確に一致していないようで、Webfactionをgit pullしたときに余分なマイグレーションがコピーされました。今、私はmakemigrationsを実行することはできませんか、もうWebfactionに移行する - 私はエラーを取得する
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0016_auto_20161030_1228, 0003_auto_20161030_1638 in locations). To fix them run 'python manage.py makemigrations --merge
私は、このコマンドを実行すると、私は次のプロンプトを参照してください。
Merging locations
Branch 0016_auto_20161030_1228
- Add field added_by to location
- Change managers on location
- Add field latlng to location
- Add field address to location
- Alter field latitude on location
- Alter field longitude on location
- Alter field country on location
Branch 0003_auto_20161030_1638
- Add field added_by to location
- Change managers on location
- Add field address to location
- Add field latlng to location
- Alter field country on location
- Alter field latitude on location
- Alter field longitude on location`
Merging will only work if the operations printed above do not conflict
with each other (working on different fields or models)
Do you want to merge these migration branches? [y/N] Please answer yes or no:
私は移行をマージしようとしたが、その列がすでに存在することを移行しようとした後にエラーが発生しました。サーバー上の
移行ファイル:ローカル上
0001_initial.py
0001_initial.pyc
0002_auto_20160416_1046.py
0002_auto_20160416_1046.pyc
0002_location_added_by.py
0002_location_added_by.pyc
0003_auto_20160416_1050.py
0003_auto_20160416_1050.pyc
0003_auto_20161030_1638.py
0003_auto_20161030_1638.pyc
0004_remove_location_category.py
0004_remove_location_category.pyc
0005_fun_nightlife_restaurant_shop.py
0005_fun_nightlife_restaurant_shop.pyc
0006_citycoverimage.py
0006_citycoverimage.pyc
0007_auto_20160416_1754.py
0007_auto_20160416_1754.pyc
0008_auto_20160416_1803.py
0008_auto_20160416_1803.pyc
0009_remove_location_reviews.py
0009_remove_location_reviews.pyc
0010_auto_20160422_1920.py
0010_auto_20160422_1920.pyc
0011_locationimage.py
0011_locationimage.pyc
0012_location_added_by.py
0012_location_added_by.pyc
0013_auto_20161029_1857.py
0013_auto_20161029_1857.pyc
0014_location_address.py
0014_location_address.pyc
0015_auto_20161030_1227.py
0015_auto_20161030_1227.pyc
0016_auto_20161030_1228.py
0016_auto_20161030_1228.pyc
__init__.py
__init__.pyc
移行ファイル:
0001_initial.py
0001_initial.pyc
0002_auto_20160228_1159.pyc
0002_auto_20160416_1046.py
0002_auto_20160416_1046.pyc
0002_location_reviews.pyc
0003_auto_20160416_1050.py
0003_auto_20160416_1050.pyc
0003_location_city.pyc
0004_auto_20160228_1255.pyc
0004_remove_location_category.py
0004_remove_location_category.pyc
0005_auto_20160228_1431.pyc
0005_fun_nightlife_restaurant_shop.py
0005_fun_nightlife_restaurant_shop.pyc
0006_citycoverimage.py
0006_citycoverimage.pyc
0006_location_category.pyc
0007_auto_20160304_2220.pyc
0007_auto_20160416_1754.py
0007_auto_20160416_1754.pyc
0008_auto_20160304_2221.pyc
0008_auto_20160416_1803.py
0008_auto_20160416_1803.pyc
0009_location_country.pyc
0009_remove_location_reviews.py
0009_remove_location_reviews.pyc
0010_auto_20160305_1505.pyc
0010_auto_20160422_1920.py
0010_auto_20160422_1920.pyc
0011_locationimage.py
0011_locationimage.pyc
0011_location_reviews.pyc
0012_location_added_by.py
0012_location_added_by.pyc
0013_auto_20161029_1857.py
0013_auto_20161029_1857.pyc
0014_location_address.py
0014_location_address.pyc
0015_auto_20161030_1227.py
0015_auto_20161030_1227.pyc
0016_auto_20161030_1228.py
0016_auto_20161030_1228.pyc
__init__.py
__init__.pyc
すべてのサーバーの移行ファイルを削除し、私は地元の移行ファイルが動作しませんでしたので、gitのプルを行います。
私はmakemigrations - fakeを読んだことがありますが、完全にそれを取得しておらず、それが役立つかどうかはわかりません。
ローカルのdbテーブル(PostgreSQL)がWebfaction(PostgreSQL)のテーブルと一致していることがわかります。
私のプロダクトをドロップしたくないですか? db。どんな支援も大歓迎です。
サーバー上でmakemigrationsを実行しないでください。それはあなたの開発マシンでやることです。 –
こんにちはダニエルは返事をありがとう。私は今、これがサーバー上での動作を実行するのに使用されているように、間違っていた場所であることに気がつきました。どのように進むべきかについての提案はありますか? – Nick