1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix database creation for postgres (again) #790 [adamm <gnuman1@gmail.com>]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@869 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-03-06 23:40:19 +00:00
parent 693e0df352
commit af081b3677

View file

@ -152,8 +152,8 @@ task :purge_test_database => :environment do
ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
when "postgresql"
`dropdb -U #{abcs["test"]["username"]} -h #{abcs[RAILS_ENV]["host"]} #{abcs["test"]["database"]}`
`createdb -U #{abcs["test"]["username"]} -h #{abcs[RAILS_ENV]["host"]} #{abcs["test"]["database"]}`
`dropdb -U #{abcs["test"]["username"]} -h #{abcs["test"]["host"]} #{abcs["test"]["database"]}`
`createdb -U #{abcs["test"]["username"]} -h #{abcs["test"]["host"]} #{abcs["test"]["database"]}`
when "sqlite","sqlite3"
File.delete(abcs["test"]["dbfile"]) if File.exist?(abcs["test"]["dbfile"])
else