Rails migration does not change schema.rb

后端 未结 6 2262
余生分开走
余生分开走 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 02:35

    'Versions' of migrations are done via timestamps. Rails checks which migrations it needs to run by comparing the timestamp of the last run migration and seeing if there are any newer.

    If the version of your new migration is 123123123, it will not be run as that number is not greater than the current timestamp (eg. 20131209170300).

提交回复
热议问题