我安裝設計,傾斜,然後實現後,我想補充:確定。如何在初始create_table耙後添加列來設計?
我可以返回到相同的初始遷移,只是取消註釋掉我想要的幫助程序,然後耙db:再次遷移?
我試過了,它似乎沒有工作。但我還沒有看到如何創建後續遷移的例子。
謝謝!
這是我的嘗試:
1 class AddConfirmableToUsers < ActiveRecord::Migration
2 def self.up
3 change_table :users do |t|
4 t.confirmable
5 end
6 add_index :users, :confirmation_token, :unique => true
7 end
8
9 def self.down
10 remove_column :users, :confirmation_token
11 end
12
13 end
好吧,我不完全知道如何做到這一點,但是這是我正在尋找我認爲...我使用了上面的助手,應該這樣做嗎? – Angela 2011-06-15 14:25:03
我會認爲使用助手會工作,但我從來沒有真正嘗試過。 – dpb 2011-06-15 21:29:01