Skip to content

Instantly share code, notes, and snippets.

View wafcio's full-sized avatar
🏠
Working from home

Chris Wawer wafcio

🏠
Working from home
  • Alterans Technologies
  • Gdynia, Poland
View GitHub Profile
@kalmbach
kalmbach / gist:4471560
Created January 7, 2013 01:27
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0