]> git.openstreetmap.org Git - rails.git/blobdiff - lib/tasks/add_version_to_nodes.rake
Merge remote-tracking branch 'upstream/pull/4842'
[rails.git] / lib / tasks / add_version_to_nodes.rake
diff --git a/lib/tasks/add_version_to_nodes.rake b/lib/tasks/add_version_to_nodes.rake
deleted file mode 100644 (file)
index 990ce5c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace 'db' do
-  desc 'Adds a version number to the noes table'
-  task :node_version  do
-    require File.dirname(__FILE__) + '/../../config/environment'
-
-    lower_bound = 0
-    increment = 100
-    node_count = OldNode.count
-    puts node_count
-    
-    while lower_bound < node_count
-    upper_bound = lower_bound + increment
-    hash = {}
-
-      OldNode.find(:all, :conditions => ['id >= ? AND id < ?',lower_bound, upper_bound], :order => 'timestamp').each do |node|
-         hash[node.id] = [] if hash[node.id].nil?
-         hash[node.id] << node
-      end
-
-      hash.each_value do |node_array|
-        n = 1
-        node_array.each do |node|
-          temp_old_node = TempOldNode.new
-          temp_old_node.id = node.id
-          temp_old_node.latitude = node.latitude
-          temp_old_node.longitude = node.longitude
-          temp_old_node.user_id = node.user_id
-          temp_old_node.visible = node.visible
-          temp_old_node.timestamp = node.timestamp
-          temp_old_node.tile = node.tile
-          temp_old_node.version = n
-          temp_old_node.save! || raise
-          n +=1 
-        end
-      end
-      lower_bound += increment
-    end
-  end
-end
-
-
-
-
-
-