How to get database schema version manually?

Hello!

I try to make automatic migrations directly from ruby script without
using rake and console commands.
But I can’t retrieve current database schema version.

I have tried to use ActiveRecord::Migration.version and @version
property in a child of ActiveRecord::Migration. The result was nil at
both cases.

How can I do this?

Thank you.

I have found the solution, but only by looking source code of
activerecord gem.

It’s simple :slight_smile:
ActiveRecord::Migrator.current_version