【问题标题】:Postgres Tables not creating even migration file existsPostgres表没有创建甚至迁移文件存在
【发布时间】:2015-02-06 09:58:26
【问题描述】:

即使 rake:db:migrate 不起作用,我也是 Rails 项目的新手,尽管 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:migrate 时它显示空白而不是创建

 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$  

在我的数据库中没有创建任何东西,即使我尝试了单个迁移文件也是这样

 rake db:migrate:up VERSION="20140822150851"

请帮帮我

【问题讨论】:

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


    【解决方案1】:

    你试过了吗

    rake db:drop
    

    & 然后

    rake db:create
    rake db:migrate
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-06
      • 2021-05-04
      • 1970-01-01
      • 1970-01-01
      • 2022-01-17
      • 2012-10-01
      • 1970-01-01
      • 2020-07-15
      相关资源
      最近更新 更多