0
A
回答
6
退房的Ruby on Rails Migration Guide。例如,在遷移中刪除表格:
class DropProducts < ActiveRecord::Migration
def self.up
drop_table :products
end
def self.down
raise ActiveRecord::IrreversibleMigration
end
end
1
這可以通過使用與下面的命令遷移來實現: -
def self.up
drop_table :table_name
end
相關問題
- 1. Rake和Ruby on Rails
- 2. rake中止! Ruby on rails
- 3. Ruby on Rails - rake db:seed aborted
- 4. Ruby on rails rake db:reseed abort
- 5. ruby on rails rake db error
- 6. Rake db:drop升級後的ruby 1.9.3-p0和Rails 3.2後不工作
- 7. Ruby on Rails 3.2.3在rake db:migrate(MySQL db)後不創建外鍵
- 8. 如何禁止heroku rake db:drop
- 9. Ruby on Rails:從rake任務執行POST
- 10. Ruby on Rails的 - Rake文件validates_uniqueness_of
- 11. rubyon rails,rake,crontab和編碼
- 12. Ruby on Rails 4 - 在Heroku上使用Rake
- 13. 如何在Elastic Beanstalk中運行'rake db:drop'
- 14. db:drop後rails仍然活着
- 15. Ruby on Rails - Ruby的新手幫助使用rake db:migrate
- 16. Ruby on Rails - Sqlite3
- 17. add_index錯誤[Ruby on Rails的]
- 18. CMS on Ruby on Rails
- 19. Ruby on Rails路線
- 20. Ruby和Rails或Ruby on Rails
- 21. Rake on Rails 3問題
- 22. Ruby與Ruby On Rails
- 23. Ruby on Rails和MongoDB
- 24. Ruby on Rails ActiveRecord :: ConnectionNotEstablished
- 25. Ruby on Rails的libyaml
- 26. Ruby on Rails fullcalendar-rails
- 27. rake db rake tasks not working Ruby 2.4.0&Rails 5.0.1
- 28. Ruby on Rails耙錯誤
- 29. Ruby On Rails數據庫
- 30. Ruby on Rails中的錯誤
請格式化所有代碼。 – JShoe 2013-07-03 04:44:02