{"issue":{"pull_request":{"diff_url":"https://github.com/lomba/schema_plus/pull/46.diff","html_url":"https://github.com/lomba/schema_plus/pull/46","patch_url":"https://github.com/lomba/schema_plus/pull/46.patch"},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/a6d2a8c0851b37a46827e3b23a84e4c0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a6d2a8c0851b37a46827e3b23a84e4c0","url":"https://api.github.com/users/jdudek","login":"jdudek","id":189572},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-13T02:06:35Z","closed_at":null,"comments":1,"url":"https://api.github.com/repos/lomba/schema_plus/issues/46","body":"As of Rails 3.1 using `belongs_to` or `references` in `rails generate model` results in `add_index` for referenced table. At the same time schema_plus creates such index which results in collision (generated migration fails). The solution is to run the generator with `--no-indexes` option, i.e. `rails g model Foo bar:belongs_to --no-indexes`. My suggestion is to configure Rails to disable these indexes by default.","html_url":"https://github.com/lomba/schema_plus/issues/46","title":"Collision with automatic generation of indexes in Rails 3.1","number":46,"id":2205181,"created_at":"2011-11-11T01:17:46Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/d969a347edb3054c711946c0ed07ce2f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d969a347edb3054c711946c0ed07ce2f","url":"https://api.github.com/users/ronen","login":"ronen","id":125620},"updated_at":"2011-11-13T02:06:35Z","url":"https://api.github.com/repos/lomba/schema_plus/issues/comments/2720479","body":"Thanks for reporting the bug and providing the patch.  \r\n\r\nBut I'm a bit wary about changing the default behavior of generators, since the expected behavior of the migration would change if the user were to turn off SchemaPlus's auto index in the global config.\r\n\r\nI'm looking into an alternative solution...","id":2720479,"created_at":"2011-11-13T02:06:35Z"}}