jalkoby / squasher

Squasher - squash your old migrations in a single command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option -m doesn't work

raykin opened this issue · comments

I run command squasher 2017/06 -m 5.0 but still get error of

StandardError: An error has occurred, this and all later migrations canceled:

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class InitSchema < ActiveRecord::Migration[4.2]
/Users/raykin/studio/deltux/db/migrate/20161025132519_init_schema.rb:1:in `<main>'
/Users/raykin/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/raykin/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'

Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class InitSchema < ActiveRecord::Migration[4.2]
/Users/raykin/studio/deltux/db/migrate/20161025132519_init_schema.rb:1:in `<main>'
/Users/raykin/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/raykin/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Tried -m 5.0, -m 5.1 and -m 4.2, all failed. My rails version is 5.1.6

Manually update all migration files to include version number. Then squasher works.