'How to migrate pending migrations in rails?

Im working on ruby on rails open source projects. So after cloning from github i setup the mentiones pg database in Gemfile by using command rails db:create successfully it created the database . Now there are 809 migration files , to migrate with postgres database i ran the

rake db:migrate

Im getting the below error

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 CreateEvents < ActiveRecord::Migration[4.2]
D:/Freelance/pupilfirst/db/migrate/20131204110627_create_events.rb:1:in `<top (required)>'

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

  class CreateEvents < ActiveRecord::Migration[4.2]
D:/Freelance/pupilfirst/db/migrate/20131204110627_create_events.rb:1:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

there are 809 migrations files are there . so can anyone help me out from this. my rails version is ``rails 6.1.5.1`



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source