lib/hoboken/templates/sequel.rake in hoboken-0.0.1 vs lib/hoboken/templates/sequel.rake in hoboken-0.9.0
- old
+ new
@@ -1,19 +1,21 @@
+# frozen_string_literal: true
+
namespace :db do
require 'sequel'
Sequel.extension :migration
- DB = Sequel.connect(ENV['DATABASE_URL'] || "sqlite://db/development.db")
+ db = Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://db/development.db')
desc 'Migrate the database to latest version'
task :migrate do
- Sequel::Migrator.run(DB, 'db/migrate')
+ Sequel::Migrator.run(db, 'db/migrate')
puts '<= db:migrate executed'
end
desc 'Perform migration reset (full erase and migration up)'
task :reset do
- Sequel::Migrator.run(DB, 'db/migrate', :target => 0)
- Sequel::Migrator.run(DB, 'db/migrate')
+ Sequel::Migrator.run(db, 'db/migrate', target: 0)
+ Sequel::Migrator.run(db, 'db/migrate')
puts '<= db:reset executed'
end
end