From c5f33db61e8ac24e578ae431f95a2566255fbf27 Mon Sep 17 00:00:00 2001 From: Nick Black Date: Wed, 23 Jan 2008 11:41:56 +0000 Subject: [PATCH] adds two migrations to create old_node_tags and node_tags table and indexes. Does not change existing table structure or populate tables with any data --- db/migrate/011_create_node_tags.rb | 21 +++++++++++++++++++++ db/migrate/012_create_old_node_tags.rb | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 db/migrate/011_create_node_tags.rb create mode 100644 db/migrate/012_create_old_node_tags.rb diff --git a/db/migrate/011_create_node_tags.rb b/db/migrate/011_create_node_tags.rb new file mode 100644 index 000000000..e0e791404 --- /dev/null +++ b/db/migrate/011_create_node_tags.rb @@ -0,0 +1,21 @@ +class CreateNodeTags < ActiveRecord::Migration + def self.up + create_table "current_node_tags", myisam_table do |t| + t.column "id", :bigint, :limit => 64 + t.column "sequence_id", :bigint, :limit => 11 + t.column "k", :string, :default => "", :null => false + t.column "v", :string, :default => "", :null => false + end + + add_index "current_node_tags", ["id"], :name => "current_node_tags_id_idx" + add_primary_key "current_node_tags", ["sequence_id", "id"] + + execute "CREATE FULLTEXT INDEX `current_node_tags_v_idx` ON `current_node_tags` (`v`)" + + + end + + def self.down + drop_table :current_node_tags + end +end diff --git a/db/migrate/012_create_old_node_tags.rb b/db/migrate/012_create_old_node_tags.rb new file mode 100644 index 000000000..329636d45 --- /dev/null +++ b/db/migrate/012_create_old_node_tags.rb @@ -0,0 +1,19 @@ +class CreateOldNodeTags < ActiveRecord::Migration + def self.up + create_table "node_tags", myisam_table do |t| + t.column "id", :bigint, :limit => 64, :default => 0, :null => false + t.column "sequence_id", :bigint, :limit => 11 + t.column "k", :string + t.column "v", :string + t.column "version", :bigint, :limit => 20 + end + + add_index "node_tags", ["version"], :name => "node_tags_id_version_idx" + add_primary_key "node_tags", ["id", "version", "sequence_id"] + + end + + def self.down + drop_table :node_tags + end +end -- 2.39.5