Rails DB command

DB command

  • Create DB

    $ rake db:create 
  • Drop DB

    $ rake db:drop 
  • Create DB table according to migrate file

    $ rake db:migrate 
  • Create a db/schema.rb file that can be portably used against any DB supported by AR

    $ rake db:schema:dump 
  • Load a schema.rb file into the database

    $ rake db:schema:load 
  • Reset db according to db\schema.rb, delete -> new again

    $ rake db:reset 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章