Postgres表不存在甚至不创建迁移文件

时间:2015-02-06 09:58:27

标签: postgresql ruby-on-rails-4 migration

我是新手,已经拥有迁移文件的项目,即使rake:db:migrate还没有工作

  $ rake db:migrate:status
/Users/frescoadmin/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Starting up a new ElasticSearch client with 

 database: roorah_development

  Status   Migration ID    Migration Name
 --------------------------------------------------
up     20140822150851  Create users
up     20140822150950  Add devise to users
up     20140825181927  Add role to users
up     20140827184709  Add active and agree to tos to users
up     20140827192137  Create owners
up     20140827213949  Create renters
up     20140828003517  Create work histories
up     20140828180541  Add work history id to renters
up     20140828220343  Add bio and tagline to owners
up     20140828222402  Add active and bio and tagline to renters
up     20140828225430  Change active column name to owners
up     20140828230511  Create coapplicants
up     20140829172647  Add work history id to coapplicants
up     20140829174553  Add coapplicant id to renters
up     20140829175505  Remove renter id in coapplicants
up     20140829181221  Create rental histories

这里我们知道迁移文件存在,但是当我给rake db:迁移它时显示空白没有创建

 FrescoMac002:Roorah frescoadmin$ rake db:migrate
/Users/frescoadmin/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Starting up a new ElasticSearch client with 
FrescoMac002:Roorah frescoadmin$  

在我的DATABASE中没有创建任何内容,即使我尝试了单个迁移文件也像这样

 rake db:migrate:up VERSION="20140822150851"

请帮助我解决这个问题

1 个答案:

答案 0 :(得分:0)

你试过

吗?
rake db:drop

&安培;那么

rake db:create
rake db:migrate