Added database tasks to Rakefile
This commit is contained in:
parent
8b742cfed7
commit
3b952dd11e
12
Rakefile
12
Rakefile
@ -1,5 +1,17 @@
|
||||
require 'bundler/setup'
|
||||
|
||||
namespace :db do
|
||||
desc 'Run migrations'
|
||||
task :migrate, [:version] do |t, args|
|
||||
require "sequel/core"
|
||||
Sequel.extension :migration
|
||||
version = args[:version].to_i if args[:version]
|
||||
Sequel.connect('sqlite://data/destructo.db') do |db|
|
||||
Sequel::Migrator.run(db, "db/migrations", target: version)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :server do
|
||||
task :start do
|
||||
ENV['APP_ENV'] = 'production'
|
||||
|
Loading…
Reference in New Issue
Block a user