몇 달 전에 FTP를 사용하여 Webfaction에 Django 1.9 프로젝트를 배포했습니다. 그러나 배포 프로세스를 자동화하기를 원했고 Webfaction의 기존 배포를 bitbucket repo에 연결했습니다.django 서버 1.9 마이그레이션 실패
내 로컬 환경 변수가 여전히 정상적으로 작동하고 오류없이 마이그레이션 할 수 있습니다. 그러나 과거에 몇 가지 마이그레이션이 정확히 일치하지 않는 것으로 보였으므로 웹 프레임 작업을 수행 할 때 추가 마이그레이션이 복사되었습니다. - 지금은 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_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
:
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
마이그레이션 지역에있는 파일.
필자는 makemigrations --fake를 읽었지만 완전히 얻지는 못했고 도움이 될지 확실하지 않았다.
로컬 db 테이블 (PostgreSQL)이 Webfaction (또한 PostgreSQL)의 테이블과 일치한다는 것을 알고 있습니다.
내 제품을 삭제하지 않는 것이 좋습니다. db. 어떤 도움이라도 대단히 감사합니다.
서버에서 makemigrations를 실행하지 않아야합니다. 그것은 당신이 당신의 dev 컴퓨터에서하는 일입니다. –
안녕 다니엘 감사합니다. 이제는 서버에서 makemigrations를 실행하는 데 사용 된 것처럼 이것이 잘못되었다는 것을 깨달았습니다. 진행 방법에 대한 제안? – Nick