node model does not match current migrations #657
Comments
Author: tom[at]compton.nu It's only failing because your node model is missing the (autogenerated) tags method. Have you run Nick's migrations by any chance? That would (at least try to) extract the node tags into a separate table, but none of the corresponding rails code is written so you would get a failure like this I think. |
Author: richard[at]systemeD.net
Indeed... do I presume I shouldn't have, then? (and if so, how do I recreate a db without the latest migrations running?) |
Author: tom[at]compton.nu Running the migrations was a bad idea, yes ;-) The repository is not in an entirely consistent state after last week's efforts... Unfortunately one of the migrations is not reversible (or at least doesn't have code to properly reverse it) but also isn't marked as irreversible. You could do "rake db:migrate VERSION=10" which might work, although you would loose any node tags which you had in the database. Otherwise you will need to drop the database and recreate it from scratch - just connect as root and do "drop database openstreetmap" and then follow the instructions for creating a database. |
Author: tom[at]compton.nu Oh, and don't forget that, if you recreate, you want to add VERSION=10 when running the migrations so you don't get Nick's bits. |
Author: richard[at]systemeD.net Thanks - that seems to work. Have updated the wiki page temporarily too. :) |
Author: tom[at]compton.nu This long since resolved. |
Reporter: richard[at]systemeD.net
[Submitted to the original trac issue database at 7.47am, Tuesday, 29th January 2008]
amf_controller is throwing an error:
[2008-01-29 09:36:38.318405 #427] NoMethodError (undefined method
tags' for #<Node:0x252b654>): /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/attribute_methods.rb:205:in
method_missing'/app/models/node.rb:153:in
tags_as_hash' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/associations/association_proxy.rb:124:in
send'yadda yadda
Currently the (unrewritten) putway (L352/353, 364/365, and calls to readwayquery and readwayquery_old), putpoi (L467/468, 471/472), getway_old (call to readwayquery_old), readwayquery (L550-560) and readwayquery_old (L568-621) contain SQL referring to the tags column in nodes.
The independent references in putway and putpoi are easily patched pending the rewrite into Rails. readwayquery and readwayquery_old currently get the nodes as part of a single query with a join to way_nodes (or current_way_nodes), so I guess are going to be harder.
The text was updated successfully, but these errors were encountered: