Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into erbout

  • Loading branch information...
commit fce22c186d624c931ec51979fc903c384db19b64 2 parents fb9bf11 + d095633
@jeremy jeremy authored
View
6 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -506,7 +506,7 @@ def create_database(name, options = {})
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 @@ def create_database(name, options = {})
# 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 @@ def pk_and_sequence_for(table) #:nodoc:
# 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.
View
4 activerecord/test/cases/active_schema_test_postgresql.rb
@@ -13,8 +13,8 @@ def teardown
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
Please sign in to comment.
Something went wrong with that request. Please try again.