]> git.openstreetmap.org Git - rails.git/commitdiff
migration 013 removes tags from nodes and old nodes tables/ 014 does not do anything atm
authorNick Black <nickb@svn.openstreetmap.org>
Wed, 23 Jan 2008 17:31:51 +0000 (17:31 +0000)
committerNick Black <nickb@svn.openstreetmap.org>
Wed, 23 Jan 2008 17:31:51 +0000 (17:31 +0000)
db/migrate/013_populate_node_tags_and_remove.rb [new file with mode: 0644]
db/migrate/014_add_version_to_nodes.rb [new file with mode: 0644]

diff --git a/db/migrate/013_populate_node_tags_and_remove.rb b/db/migrate/013_populate_node_tags_and_remove.rb
new file mode 100644 (file)
index 0000000..f364231
--- /dev/null
@@ -0,0 +1,13 @@
+class PopulateNodeTagsAndRemove < ActiveRecord::Migration
+  def self.up
+
+    #rake import 
+    remove_column :nodes, :tags
+    remove_column :current_nodes, :tags
+  end
+
+  def self.down
+    add_column :nodes, "tags", :text, :default => "", :null => false
+    add_column :current_nodes, "tags", :text, :default => "", :null => false
+  end
+end
diff --git a/db/migrate/014_add_version_to_nodes.rb b/db/migrate/014_add_version_to_nodes.rb
new file mode 100644 (file)
index 0000000..8afa548
--- /dev/null
@@ -0,0 +1,10 @@
+class AddVersionToNodes < ActiveRecord::Migration
+  def self.up
+    add_column :nodes, :version, :bigint, :limit => 20, :default => 0, :null => false
+  end
+
+  def self.down
+    remove_column :nodes, :version
+    add_index "nodes", ["id"], :name => "nodes_uid_idx"
+  end
+end