Rails DB command

来源:互联网 发布:大数据 包嗅探器 编辑:程序博客网 时间:2024/05/22 04:49

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 
原创粉丝点击