Reputation:
I'm trying to run some migrations on a database via Sequel's Sequel::Migrator
. However, when I run...
DB = Sequel.sqlite
Sequel::Migrator.apply DB, 'db/migrations'
I got the following error.
uninitialized constant Sequel::Migrator
What gives?
Upvotes: 1
Views: 955
Reputation:
Nowadays Sequel::Migrator
is not included by default. This means that you just can't require 'sequel'
and be able to start using Sequel::Migrator
right away.
Instead you have to load the migration and core extensions provided by Sequel like so.
Sequel.extension :migration, :core_extensions
Now if you check whether Sequel::Migrator
is defined Ruby should return "constant"
.
1.9.3 :001 > Sequel.extension :migration, :core_extensions
=> [:migration, :core_extensions]
1.9.3 :002 > defined? Sequel::Migrator
=> "constant"
Upvotes: 5