diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-07 17:44:16 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-07 17:44:16 -0700 |
commit | fce22c186d624c931ec51979fc903c384db19b64 (patch) | |
tree | f6daf49ef83fc498277c2f28d48f4db64c2b7e46 | |
parent | fb9bf119fe700d25cf28502fd56a8b38f5806b47 (diff) | |
parent | d0956335a677aeb3b78393aa6ecd05cb7e4384f4 (diff) | |
download | rails-fce22c186d624c931ec51979fc903c384db19b64.tar.gz rails-fce22c186d624c931ec51979fc903c384db19b64.tar.bz2 rails-fce22c186d624c931ec51979fc903c384db19b64.zip |
Merge branch 'master' into erbout
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 | ||||
-rw-r--r-- | activerecord/test/cases/active_schema_test_postgresql.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 7dbfbb41f6..049e6f61de 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -506,7 +506,7 @@ module ActiveRecord end end - execute "CREATE DATABASE #{name}#{option_string}" + execute "CREATE DATABASE #{quote_table_name(name)}#{option_string}" end # Drops a PostgreSQL database @@ -514,7 +514,7 @@ module ActiveRecord # Example: # drop_database 'matt_development' def drop_database(name) #:nodoc: - execute "DROP DATABASE IF EXISTS #{name}" + execute "DROP DATABASE IF EXISTS #{quote_table_name(name)}" end @@ -676,7 +676,7 @@ module ActiveRecord # Renames a table. def rename_table(name, new_name) - execute "ALTER TABLE #{name} RENAME TO #{new_name}" + execute "ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_table_name(new_name)}" end # Adds a new column to the named table. diff --git a/activerecord/test/cases/active_schema_test_postgresql.rb b/activerecord/test/cases/active_schema_test_postgresql.rb index db325e3fb4..af80f724f2 100644 --- a/activerecord/test/cases/active_schema_test_postgresql.rb +++ b/activerecord/test/cases/active_schema_test_postgresql.rb @@ -13,8 +13,8 @@ class PostgresqlActiveSchemaTest < Test::Unit::TestCase end def test_create_database_with_encoding - assert_equal "CREATE DATABASE matt ENCODING = 'utf8'", create_database(:matt) - assert_equal "CREATE DATABASE aimonetti ENCODING = 'latin1'", create_database(:aimonetti, :encoding => :latin1) + assert_equal %(CREATE DATABASE "matt" ENCODING = 'utf8'), create_database(:matt) + assert_equal %(CREATE DATABASE "aimonetti" ENCODING = 'latin1'), create_database(:aimonetti, :encoding => :latin1) end private |