Originally created by @ferdi2005 on GitHub (Aug 11, 2019).
rails aborted!
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 CreateCronoJobs < ActiveRecord::Migration[4.2]
Originally created by @ferdi2005 on GitHub (Aug 11, 2019).
rails aborted!
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 CreateCronoJobs < ActiveRecord::Migration[4.2]
The issue here wasn't the [4.2]. It's the fact that Crono's generated migration doesn't have the version tag in it at all.
My migration came like this
classCreateCronoJobs<ActiveRecord::Migrationdefself.upcreate_table:crono_jobsdo|t|t.string:job_id,null:falset.text:log,limit:1073741823# LONGTEXT for MySQLt.datetime:last_performed_att.boolean:healthyt.timestampsnull:falseendadd_index:crono_jobs,[:job_id],unique:trueenddefself.downdrop_table:crono_jobsendend
Naturally, this is easily fixed by hand. But I think the generator should already be doing this. Since this structure has been standard for a while now.
@ClikeX commented on GitHub (Aug 13, 2020):
The issue here wasn't the [4.2]. It's the fact that Crono's generated migration doesn't have the version tag in it at all.
My migration came like this
```ruby
class CreateCronoJobs < ActiveRecord::Migration
def self.up
create_table :crono_jobs do |t|
t.string :job_id, null: false
t.text :log, limit: 1073741823 # LONGTEXT for MySQL
t.datetime :last_performed_at
t.boolean :healthy
t.timestamps null: false
end
add_index :crono_jobs, [:job_id], unique: true
end
def self.down
drop_table :crono_jobs
end
end
```
Naturally, this is easily fixed by hand. But I think the generator should already be doing this. Since this structure has been standard for a while now.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ferdi2005 on GitHub (Aug 11, 2019).
rails aborted!
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 CreateCronoJobs < ActiveRecord::Migration[4.2]
@alliedarmour commented on GitHub (Oct 20, 2019):
Just replace the [4.2] with the version you are using, in my case it's [6.0]
@ClikeX commented on GitHub (Aug 13, 2020):
The issue here wasn't the [4.2]. It's the fact that Crono's generated migration doesn't have the version tag in it at all.
My migration came like this
Naturally, this is easily fixed by hand. But I think the generator should already be doing this. Since this structure has been standard for a while now.
@plashchynski commented on GitHub (May 30, 2022):
Fixed in the new version of the gem (2.0.0)