diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-07 13:39:03 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-07 13:39:03 -0700 |
commit | 21bb0f40b075e7b878e7ae0fd6c40c9a9ad5b00a (patch) | |
tree | 43fecea7205afd4d26350ed279896ebf2aba8157 /activerecord | |
parent | 5b53a0695904afb6a576fe5a9badbf14261909b5 (diff) | |
download | rails-21bb0f40b075e7b878e7ae0fd6c40c9a9ad5b00a.tar.gz rails-21bb0f40b075e7b878e7ae0fd6c40c9a9ad5b00a.tar.bz2 rails-21bb0f40b075e7b878e7ae0fd6c40c9a9ad5b00a.zip |
PostgreSQL: quote bare table names
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 |
1 files changed, 3 insertions, 3 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. |