Permalink
Browse files

Updated rake tasks.

  • Loading branch information...
1 parent 1e76f9d commit 243138523247de3303c4fd1ab9c55d59b92baa29 @willawill willawill committed Feb 19, 2014
Showing with 6 additions and 11 deletions.
  1. +1 −1 Gemfile
  2. +5 −10 Rakefile
View
@@ -8,7 +8,7 @@ gem 'sinatra-authentication'
gem 'rack-ssl'
gem 'foreman'
gem 'datamapper'
-gem 'dm-postgres-adapter'
+gem 'dm-postgres-adapter',:require => true
gem 'dm-observer'
gem 'pusher'
View
@@ -1,5 +1,5 @@
$LOAD_PATH.unshift 'lib'
-
+require 'rake'
require 'resque/tasks'
task :environment, :env do |cmd, args|
@@ -9,24 +9,19 @@ end
namespace :db do
+ desc "Create database, env symbol are in [development, test, production]."
task :migrate, :env do |cmd, args|
env = args[:env] || "development"
Rake::Task['environment'].invoke(env)
- database_url = ENV["DATABASE_URL"] || "postgres://localhost/crowdring_#{env}"
- DataMapper.setup(:default, database_url)
- DataMapper.finalize
- DataMapper.auto_upgrade!
+ DataMapper.repository.auto_migrate!
end
- task :reset, :env do |cmd, args|
+ task :update, :env do |cmd, args|
env = args[:env] || "development"
Rake::Task['environment'].invoke(env)
- database_url = ENV["DATABASE_URL"] || "postgres://localhost/crowdring_#{env}"
- DataMapper.setup(:default, database_url)
- DataMapper.finalize
- DataMapper.auto_migrate!
+ DataMapper.repository.auto_upgrade!
User.set(
email: ENV["ADMIN_EMAIL"] || 'frodo@crowdring.org',

0 comments on commit 2431385

Please sign in to comment.