aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-11-02 03:30:15 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-11-02 03:30:15 +0000
commitf457ef46cfa5f7729ca95a2b2951c728d874fed4 (patch)
tree98417b83ef85dd9dd73ba237703ea16a0d078087
parentddf6910941977a03108f437956204580a3d0450a (diff)
downloadrails-f457ef46cfa5f7729ca95a2b2951c728d874fed4.tar.gz
rails-f457ef46cfa5f7729ca95a2b2951c728d874fed4.tar.bz2
rails-f457ef46cfa5f7729ca95a2b2951c728d874fed4.zip
If specified, pass PostgreSQL client character encoding to createdb. Closes #2703.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/tasks/databases.rake3
2 files changed, 4 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index eed9a4e4b1..ced871f3b1 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* If specified, pass PostgreSQL client character encoding to createdb. #2703 [Kazuhiko <kazuhiko@fdiary.net>]
+
* Catch CGI multipart parse errors. Wrap dispatcher internals in a failsafe response handler. [Jeremy Kemper]
* The freeze_gems Rake task accepts the VERSION environment variable to decide which version of Rails to pull into vendor/rails. [Chad Fowler, Jeremy Kemper]
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"