This project is archived and is in readonly mode.
Rails-2.3.8 db:migrate gives undefined method `length' for :any_index:Symbol
-
Étienne Barrié
- Tag changed from rake db:migrate rails-2.3.8 bug to rake db:migrate rails-2.3.8 bug, patch
Thanks for your report. I fixed it in the attached patch. Applies on 2-3-stable but can be cherry-picked to master too.
Meanwhile, you can just change your symbol into strings and the migrations should work.
-
James B. Byrne
Thank you.
-
James B. Byrne
Applied this patch and it resolves our problem with AR-2.3.8.
-
Brian Durand
This same issue is present in 3.0.0.beta4.
-
Brian Durand
- Tag changed from rake db:migrate rails-2.3.8 bug, patch to rake db:migrate rails-2.3.8 bug, 3.0, patch
-
Étienne Barrié
Yes it's also present in master. This patch still applies on both 2-3-stable and master and solves that problem.
-
James B. Byrne
Since this is still present in 2.3.9 and this ticket is still classed as 'new' am I to conclude that it is not yet fixed in 3.0.0? If so, what is preventing this issue from being fixed in a standard release.
-
Jeremy Kemper
- Milestone set to 2.3.10
- State changed from new to open
- Assigned user set to Aaron Patterson
- Importance changed from to Low
-
Étienne Barrié
James, yes and no. It’s fixed in 3.0.0 and master (7a1bba4799f3fae2c3699816bc071128fd591461 and c0fa4de65b32fc5e8251dafab1330f044d682a1e), but only for add_index, and not for remove_index.
The original patch still applies (with offsets) on 2-3-stable, but you’ll need a slightly different patch (attached) for master and 3-0-stable.
-
Aaron Patterson
Hi Étienne, I've applied your patch for 2-3-stable. Can you rebase your patch for master / 3-0-stable, and I'll apply it? Currently, it doesn't apply.
-
Étienne Barrié
The problem this patch was solving (which I am responsible for :( ) was fixed in a few different commits for master / 3-0-stable. First add_index was fixed as I explained in my previous comment. And yesterday, remove_index was fixed too. (http://github.com/rails/rails/commit/d6f7b7d35337b87cc1c419e47fae52....
So basically now the patch for master is useless. But if you use the new attached patch anyway, you’ll get a test specific to symbolic index names, add_index will be again compatible to a long forgotten time where its third argument was "UNIQUE", and a tiny and totally useless performance improvement which is just here because that's the way I had coded the patch before the other patch rendered it useless :D
I think it's worth it for the test alone, for consistency with 2-3-stable.
-
Aaron Patterson
- State changed from open to committed
Étienne,
I agree. I
I've committed this patch. Thanks!
-
Andrea Campi
- Tag changed from rake db:migrate rails-2.3.8 bug, 3.0, patch to 2-3-stable, 3.0, migrations, patch
