以下是基本知識。我在SANDBOX環境中進行了部署。Rails模式&遷移繼續恢復到VERSION = 0
我做了一些更改,並嘗試重新部署。這個堆棧是第3章的Postgres DB/Rails 4.2
在部署之前,它從來沒有任何問題,當它運行遷移時,它不應該有,因爲沒有掛起的,它基本上滾動將所有遷移都恢復到0狀態。
我在開發環境中成功創建了這個錯誤。 我不得不從之前的提交中恢復模式文件,因爲當然返回將所有內容都回滾了。
所以現在。
ActiveRecord::Schema.define(version: 20151214201502) do ...
而最後遷移文件
20151214201502_create_host_group_membership_table
當我嘗試和部署,或運行rake db:migrate
我一共拿到了逆轉。所有表都被丟棄。
Schema.rb讀取ActiveRecord::Schema.define(version: 0) do
和rake db:migrate:status
讀取>
Status Migration ID Migration Name
--------------------------------------------------
down 20150916151324 Create ...<edited> table
down 20150916190627 Create ...<edited> table
down 20150916195012 Create ...<edited> table
down 20150918112956 Create ...<edited> table
down 20151019175551 Create ...<edited> table
down 20151020195644 Create ...<edited> table
down 20151020202321 Create ...<edited> table
down 20151026021111 Create ...<edited> table
down 20151124161525 Create ...<edited> table
down 20151124185807 Create ...<edited> table
down 20151214201502 Create ...<edited> table
和任何後續耙分貝:遷移在什麼結果。
謝謝。這正是發生的事情。忘記更新票證。感謝你的回答。 似乎很奇怪,這樣一個常見的關鍵字將用於此。 –