From e0c67d8404a91b8a292055e6ffaba1a2359f0801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Wed, 2 Sep 2015 17:24:14 +0200 Subject: [PATCH] adds ancestry column to comments --- db/migrate/20150902114558_add_ancestry_to_comments.rb | 7 +++++++ db/schema.rb | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20150902114558_add_ancestry_to_comments.rb diff --git a/db/migrate/20150902114558_add_ancestry_to_comments.rb b/db/migrate/20150902114558_add_ancestry_to_comments.rb new file mode 100644 index 000000000..7037c7e68 --- /dev/null +++ b/db/migrate/20150902114558_add_ancestry_to_comments.rb @@ -0,0 +1,7 @@ +class AddAncestryToComments < ActiveRecord::Migration + def change + add_column :comments, :ancestry, :string + + add_index :comments, :ancestry + end +end diff --git a/db/schema.rb b/db/schema.rb index 883d2a7e1..8b8dd88e9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150830212600) do +ActiveRecord::Schema.define(version: 20150902114558) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -62,9 +62,6 @@ ActiveRecord::Schema.define(version: 20150830212600) do t.text "body" t.string "subject" t.integer "user_id", null: false - t.integer "parent_id" - t.integer "lft" - t.integer "rgt" t.datetime "created_at" t.datetime "updated_at" t.integer "children_count", default: 0 @@ -77,8 +74,13 @@ ActiveRecord::Schema.define(version: 20150830212600) do t.integer "cached_votes_up", default: 0 t.integer "cached_votes_down", default: 0 t.datetime "confirmed_hide_at" + t.string "ancestry" + t.integer "rgt" + t.integer "lft" + t.integer "parent_id" end + add_index "comments", ["ancestry"], name: "index_comments_on_ancestry", using: :btree add_index "comments", ["cached_votes_down"], name: "index_comments_on_cached_votes_down", using: :btree add_index "comments", ["cached_votes_total"], name: "index_comments_on_cached_votes_total", using: :btree add_index "comments", ["cached_votes_up"], name: "index_comments_on_cached_votes_up", using: :btree