lib/bitcoin/storage/storage.rb in bitcoin-ruby-0.0.3 vs lib/bitcoin/storage/storage.rb in bitcoin-ruby-0.0.4
- old
+ new
@@ -99,9 +99,10 @@
# check if schema is up to date and migrate to current version if necessary
def migrate
migrations_path = File.join(File.dirname(__FILE__), "#{backend_name}/migrations")
Sequel.extension :migration
unless Sequel::Migrator.is_current?(@db, migrations_path)
+ log = @log; @db.instance_eval { @log = log }
Sequel::Migrator.run(@db, migrations_path)
unless (v = @db[:schema_info].first) && v[:magic] && v[:backend]
@db[:schema_info].update(
magic: Bitcoin.network[:magic_head].hth, backend: backend_name)
end