Permalink
Switch branches/tags
v0.1.0 deploy.2015-01-26.13-01 deploy.2015-01-26.12-59 deploy.2014-10-15.04-55 deploy.2014-10-15.04-54 deploy.2014-10-15.04-52 deploy.2014-10-15.04-51 deploy.2014-10-15.04-50 deploy.2014-10-15.04-49 deploy.2014-10-14.16-32 deploy.2014-10-14.16-31 deploy.2014-10-12.15-19 deploy.2014-10-11.12-31 deploy.2014-10-02.12-20 deploy.2014-09-19.09-21 deploy.2014-08-06.12-06 deploy.2014-08-05.10-47 deploy.2014-07-29.12-55 deploy.2014-07-08.12-23 deploy.2014-07-03.10-03 deploy.2014-06-20.08-17 deploy.2014-05-21.10-33 deploy.2014-05-06.09-37 deploy.2014-05-06.09-36 deploy.2014-05-01.15-37 deploy.2014-05-01.00-15 deploy.2014-04-30.06-36 deploy.2014-04-18.12-34 deploy.2014-04-08.00-51 deploy.2014-03-12.08-26 deploy.2014-02-11.12-01 deploy.2014-01-29.16-46 deploy.2014-01-29.15-58 deploy.2014-01-14.16-46 deploy.2014-01-14.13-39 deploy.2013-12-16.12-52 deploy.2013-12-10.12-28 deploy.2013-12-05.14-10 deploy.2013-12-04.12-56 deploy.2013-12-03.09-57 deploy.2013-11-28.13-20 deploy.2013-11-22.20-21 deploy.2013-11-13.09-39 deploy.2013-11-08.18-57 deploy.2013-11-08.17-13 deploy.2013-11-08.16-23 deploy.2013-11-08.13-16 deploy.2013-11-08.10-20 deploy.2013-10-16.16-30 deploy.2013-10-15.12-36 deploy.2013-10-15.12-33 deploy.2013-09-26.15-03 deploy.2013-09-26.13-35 deploy.2013-09-10.11-07 deploy.2013-09-04.12-24 deploy.2013-09-04.11-30 deploy.2013-09-04.10-53 deploy.2013-09-04.10-38 deploy.2013-08-29.09-43 deploy.2013-08-21.00-02 deploy.2013-08-14.17-18 deploy.2013-08-14.17-10 deploy.2013-08-14.10-40 deploy.2013-08-14.10-32 deploy.2013-08-14.10-25 deploy.2013-08-14.09-48 deploy.2013-08-14.09-33 deploy.2013-07-23.15-32 deploy.2013-07-14.15-43 deploy.2013-07-12.21-13 deploy.2013-07-08.13-35 deploy.2013-07-05.17-31 deploy.2013-07-04.15-20 deploy.2013-07-04.13-49 deploy.2013-07-04.13-32 deploy.2013-06-22.18-32 deploy.2013-06-22.18-17 deploy.2013-06-22.17-58 deploy.2013-06-22.17-46 deploy.2013-06-10.11-41 deploy.2013-06-10.09-51 deploy.2013-05-23.12-55 deploy.2013-05-23.12-52 deploy.2013-05-22.13-27 deploy.2013-05-20.14-02 deploy.2013-05-10.12-03 deploy.2013-05-06.17-40 deploy.2013-05-05.02-29 deploy.2013-05-05.01-57 deploy.2013-05-04.23-51 deploy.2013-05-01.21-50 deploy.2013-04-24.18-02 deploy.2013-04-22.14-02 deploy.2013-04-19.06-44 deploy.2013-04-17.19-23 deploy.2013-04-16.15-46 deploy.2013-04-12.13-29 deploy.2013-04-12.10-24 deploy.2013-03-30.11-34 deploy.2013-03-25.12-20
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 540 Bytes
namespace :db do
desc "Create and migrate the database"
task :create do
env = ENV["ENV"] || 'test'
abort "Cannot run rake db:create in production." if env == 'production'
url = "https://raw.githubusercontent.com/travis-ci/travis-migrations/master/db/main/structure.sql"
file = 'db/main/structure.sql'
system "curl -fs #{url} -o #{file} --create-dirs"
abort "failed to download #{url}" unless File.exist?(file)
sh "createdb travis_#{env}" rescue nil
sh "psql -q travis_#{env} < #{file}"
end
end