aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r--railties/lib/tasks/databases.rake3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 97c07f97f9..c9a081502e 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -101,8 +101,9 @@ task :purge_test_database => :environment do
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"]
ENV['PGPASSWORD'] = abcs["test"]["password"].to_s if abcs["test"]["password"]
+ enc_option = "-E #{abcs["test"]["encoding"]}" if abcs["test"]["encoding"]
`dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
- `createdb -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
+ `createdb #{enc_option} -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
when "sqlite","sqlite3"
File.delete(abcs["test"]["dbfile"]) if File.exist?(abcs["test"]["dbfile"])
when "sqlserver"