Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4764 (closed defect: fixed)

Opened 3 years ago

Last modified 1 year ago

[PATCH] ActiveRecord Schema Quoting For Indexes

Reported by: rails@johnwlong.com Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version:
Severity: normal Keywords: patch quote quoting index add_index remove_index
Cc: rails@johnwlong.com

Description

Active Record does not quote index names when it creates or removes them. This causes a problem when you use index names that are key words.

Attachments

add_index_quoting_patch_1.patch (3.6 kB) - added by rails@johnwlong.com on 04/17/06 17:24:25.
adds quoting in schema_statements.rb

Change History

04/17/06 17:24:25 changed by rails@johnwlong.com

  • attachment add_index_quoting_patch_1.patch added.

adds quoting in schema_statements.rb

04/20/06 02:41:08 changed by rick

  • status changed from new to closed.
  • resolution set to fixed.

(In [4239]) Properly quote index names in migrations (closes #4764) [John Long]

04/20/06 02:48:55 changed by rick

(In [4240]) applying to stable: Properly quote index names in migrations (closes #4764) [John Long]

07/03/06 22:31:31 changed by roland@rv-net.de

  • status changed from closed to reopened.
  • resolution deleted.
  • summary changed from [PATCH] ActiveRecord Schema Quoting For Indexes to [BUG] ActiveRecord Schema Quoting For Indexes.

this may be the correct behaviour for the index name, but not for the indexed columns, because it's killing the possibility to index the result of functions (as possible in postgres). this creates an upcase index on contacts(name):

add_index("contacts", ["upper(name)"], :name=>"contacts_name", :unique=>false);

(worked with 1.1.2 but not with 1.1.3)

06/18/07 14:52:03 changed by josh

  • status changed from reopened to closed.
  • resolution set to fixed.
  • summary changed from [BUG] ActiveRecord Schema Quoting For Indexes to [PATCH] ActiveRecord Schema Quoting For Indexes.

roland@rv-net.de, File another ticket if you still are having that issue.