ruby on rails - How to ignore pending migrations? -
i have rails app connects rails app database. have several common models. when using console, works fine (activerecord queries tables properly), when using web server, rails checks pending migrations , raises error migrations pending. want pass check these 2 apps have different migrations. , start server. tried:
config.active_record[:migration_error] = false config.active_record.migration_error = false but no luck. how can make rails ignore pending migrations? skip check? or there way name them somehow, or set appropriate mtime, last migration file?
try in appropriate environment file in in rails_root/config/environments/ development.rb , staging.rb or production.rb
config.active_record.migration_error = false since rails stores migration information in table called schema_migrations. can add version migration table skip specific migration. version number string comes before description in file name.
alternatively, can rename migration example from
20160801105511_your_table.rb to
.20160801105511_your_table.rb add dot @ start of filename. hope work.
Comments
Post a Comment