我有一個問題來恢復上次遷移。rake db:回滾恢復錯誤的遷移
自從我安裝'letrate'gem for rating後,任何rake db:rollback
都會精確地恢復遷移,而不是最後一次遷移。
我懷疑這是由於寶石本身。
任何想法如何解決這個問題,所以我可以享受非常方便的回滾?
同樣發出相同的用:
rake db:migrate:redo
結果:
== CreateRates: reverting ====================================================
-- drop_table(:rates)
-> 0.0224s
== CreateRates: reverted (0.0225s) ===========================================
== CreateRates: migrating ====================================================
-- create_table(:rates)
NOTICE: CREATE TABLE will create implicit sequence "rates_id_seq" for serial column "rates.id"
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index "rates_pkey" for table "rates"
-> 0.1787s
-- add_index(:rates, :rater_id)
-> 0.0032s
-- add_index(:rates, [:rateable_id, :rateable_type])
-> 0.0024s
== CreateRates: migrated (0.1850s) ===========================================
耙分貝:遷移:狀態
...
up 20121205224038 Rename user address column
up 20121206125016587 ********** NO FILE **********
up 20121206125016605 ********** NO FILE **********
up 20121210152550 Create reservations
up 20121210180233 Create transactions
up 20121210215840 ********** NO FILE **********
up 20121218144200 Create videos
up 20121218144800 Add video to videos
up 20130108225007 Devise invitable add to users
up 20130130202046 Acts as taggable on migration
up 20130205154206 Create commissions
up 20130207133520 Add user id to event transition
和文件
[email protected] 1 joel staff 137 Dec 7 16:40 20121205224038_rename_user_address_column.rb
[email protected] 1 joel staff 443 Dec 7 16:40 20121206125016587_create_rating_caches.rb
[email protected] 1 joel staff 432 Dec 7 16:40 20121206125016605_create_rates.rb
[email protected] 1 joel staff 429 Dec 10 23:30 20121210152550_create_reservations.rb
[email protected] 1 joel staff 414 Dec 10 19:03 20121210180233_create_transactions.rb
[email protected] 1 joel staff 237 Dec 18 15:44 20121218144200_create_videos.rb
[email protected] 1 joel staff 172 Dec 18 16:18 20121218144800_add_video_to_videos.rb
[email protected] 1 joel staff 758 Jan 8 23:50 20130108225007_devise_invitable_add_to_users.rb
-rw-r--r-- 1 joel admin 775 Jan 30 21:20 20130130202046_acts_as_taggable_on_migration.rb
[email protected] 1 joel admin 422 Feb 5 17:05 20130205154206_create_commissions.rb
[email protected] 1 joel admin 266 Feb 7 15:20 20130207133520_add_user_id_to_event_transition.rb
要儘快嘗試。非常感謝。我會看看如果我已經可以給你+50賞金。你真的應得的。 – zabumba
沒問題,我只希望它能像我期望的那樣工作,你會得到解決的。 :) – deivid