I 업그레이드 된 슈 프레 상공 버전 3.0에서 버전 3.1로하지만고정 레일 마이그레이션 카피 스트라 노
내가 대신 마이그레이션 파일을 생성 내 로컬 개발 환경에서 망할 놈의 마이그레이션 파일에서 확인하는 것을 잊었다 대신에 서버에; 내 개발 환경에서 git로 마이그레이션을 커밋했지만 이제는 테이블이 존재할 때 마이그레이션을 실행하려고하기 때문에 배포와 관련된 모든 문제가 발생합니다.
서버에 있기 때문에 마이그레이션을 수행 할 필요가 없습니다. 서버 프로그램에 rake db:migrate:status
실행
:
up 20151015124064 Add meta title to page.spree static content
up 20151015124065 Add render as partial for layout for spree pages.spree static content
up 20151015124066 Add pages stores.spree static content
down 20160707102753 Create spree store credits.spree
down 20160707102754 Create spree store credit categories.spree
down 20160707102755 Create spree store credit events.spree
down 20160707102756 Create spree store credit types.spree
down 20160707102757 Add missing indexes.spree
down 20160707102758 Remove duplicated indexes from multi columns.spree
down 20160707102759 Remove user index from spree state changes.spree
down 20160707102760 Add position to spree payment methods.spree
down 20160707102761 Add taxable adjustment total to line item.spree
down 20160707102762 Migrate payment methods display.spree
down 20160707102763 Spree payment method store credits.spree
down 20160707102764 Rename has and belongs to associations to model names.spree
down 20160707102765 Spree store credit types.spree
down 20160707102766 Add discontinued to products and variants.spree
down 20160707102767 Remove shipping method id from spree orders.spree
down 20160707102768 Add id column to earlier habtm tables.spree
down 20160707102769 Add indexes.spree
down 20160707102770 Add missing indices on user.spree auth
down 20160707102771 Remove show in footer from spree pages.spree static content
내 위치 시스템에서 그것을 보여줍니다
up 20151015124064 Add meta title to page.spree static content
up 20151015124065 Add render as partial for layout for spree pages.spree static content
up 20151015124066 Add pages stores.spree static content
up 20160707102753 Create spree store credits.spree
up 20160707102754 Create spree store credit categories.spree
up 20160707102755 Create spree store credit events.spree
up 20160707102756 Create spree store credit types.spree
up 20160707102757 Add missing indexes.spree
up 20160707102758 Remove duplicated indexes from multi columns.spree
up 20160707102759 Remove user index from spree state changes.spree
up 20160707102760 Add position to spree payment methods.spree
up 20160707102761 Add taxable adjustment total to line item.spree
up 20160707102762 Migrate payment methods display.spree
up 20160707102763 Spree payment method store credits.spree
up 20160707102764 Rename has and belongs to associations to model names.spree
up 20160707102765 Spree store credit types.spree
up 20160707102766 Add discontinued to products and variants.spree
up 20160707102767 Remove shipping method id from spree orders.spree
up 20160707102768 Add id column to earlier habtm tables.spree
up 20160707102769 Add indexes.spree
up 20160707102770 Add missing indices on user.spree auth
up 20160707102771 Remove show in footer from spree pages.spree static content
내가 up
하지 down
해야 서버의 마이그레이션 상태를 추정한다.
어떻게 접근해야할까요?
감사합니다. Vishal, 데이터가 있습니다. 불행히도 마이그레이션을 시도합니다. 테이블이 이미 존재하므로 실패합니다. 테이블을 삭제해도 문제는 없지만 되돌릴 수없는 마이그레이션이 있습니다. –
비가역 마이그레이션은 실행 테이블 또는 다른 테이블의 일부이며 가능한 경우 되돌릴 수없는 마이그레이션 파일을 나열 할 수 있습니다. –
그리고 마이그레이션이 성공하지 못했기 때문에 되돌릴 수없는 모든 이전에 대해 ** 변한 ** 대신 ** 변신 ** 및 ** 변신 ** ** 메서드를 추가 할 수 있으므로 마이그레이션 및 롤백을위한 다른 논리를 작성할 수 있습니다. 그리고 SQL을 덤프하여 데이터를 보관할 수 있습니다. –