Rails migration does not change schema.rb

后端 未结 6 2260
余生分开走
余生分开走 2020-12-24 02:34

I have a rails migration that is not being applied to my schema.rb. The migration should create a table:

class CreateUserGraphs < ActiveRecord::Migration
         


        
6条回答
  •  时光取名叫无心
    2020-12-24 03:00

    I had the same issue. I am working in development environment (with Passenger and Apache). Production and development environments use the same database.

    When I run rake db:migrate, the db was changed, but the schema was not updated. Then I run rake db:migrate RAILS_ENV=development, and now the schema was updated.

    Seems that rails/rake are confused about my environment. Passenger sets a development environment for this site, but rake aboutsays "Environment production".

提交回复
热议问题