2017-02-13 144 views
0

我需要刪除'ckeditor gem'並將其替換爲'trumbowyg_rails gem' Ckeditor已在所有頁面中正確實現,並且還爲create_table完成了遷移「ckeditor_assets 「在添加trumbowyg_rails gem之前,我如何刪除此遷移並清除rails應用程序?Rails:刪除CKEditor並添加新的遷移以刪除它

+0

'rails d ckeditor:install'試試這個 – uzaif

+0

這會破壞db/migrate文件夾中的######### _ create_ckeditor_assets,但是在schema.rb中,create_table「ckeditor_assets」仍然存在。有沒有辦法創建一個新的遷移來銷燬它,以便它可以在生產環境中工作? – NjFern

+0

只是創建刪除'ckeditor表'的移植 – uzaif

回答

0

要回滾之前完成的遷移,可以使用rails db:rollback。使用刪除寶石gem uninstall ckeditor

編輯:

刪除使用遷移

rails g migration deleteTableTableName 

然後打開文件,並

def up 
    drop_table :table_name 
end 

然後

rails db:migrate 

I H沒有做到這一點(我更喜歡回滾),但這應該工作。

+0

有沒有辦法創建一個新的遷移來銷燬它,因此它將在生產中工作?我不喜歡使用rake db:rollback – NjFern