diff --git a/db/migrate/20180129190931_add_valuation_flag_to_comments.rb b/db/migrate/20180129190931_add_valuation_flag_to_comments.rb new file mode 100644 index 000000000..cf31a92e7 --- /dev/null +++ b/db/migrate/20180129190931_add_valuation_flag_to_comments.rb @@ -0,0 +1,5 @@ +class AddValuationFlagToComments < ActiveRecord::Migration + def change + add_column :comments, :valuation, :boolean, default: false + end +end diff --git a/db/migrate/20180129190950_add_index_to_valuation_comments.rb b/db/migrate/20180129190950_add_index_to_valuation_comments.rb new file mode 100644 index 000000000..2816d15b0 --- /dev/null +++ b/db/migrate/20180129190950_add_index_to_valuation_comments.rb @@ -0,0 +1,7 @@ +class AddIndexToValuationComments < ActiveRecord::Migration + disable_ddl_transaction! + + def change + add_index :comments, :valuation, algorithm: :concurrently + end +end diff --git a/db/schema.rb b/db/schema.rb index 219707f69..a6fc6ef88 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: 20180119073228) do +ActiveRecord::Schema.define(version: 20180129190950) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -234,7 +234,7 @@ ActiveRecord::Schema.define(version: 20180119073228) do t.string "commentable_type" t.text "body" t.string "subject" - t.integer "user_id", null: false + t.integer "user_id", null: false t.datetime "created_at" t.datetime "updated_at" t.datetime "hidden_at" @@ -247,7 +247,8 @@ ActiveRecord::Schema.define(version: 20180119073228) do t.integer "cached_votes_down", default: 0 t.datetime "confirmed_hide_at" t.string "ancestry" - t.integer "confidence_score", default: 0, null: false + t.integer "confidence_score", default: 0, null: false + t.boolean "valuation", default: false end add_index "comments", ["ancestry"], name: "index_comments_on_ancestry", using: :btree @@ -257,6 +258,7 @@ ActiveRecord::Schema.define(version: 20180119073228) do add_index "comments", ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree add_index "comments", ["hidden_at"], name: "index_comments_on_hidden_at", using: :btree add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree + add_index "comments", ["valuation"], name: "index_comments_on_valuation", using: :btree create_table "communities", force: :cascade do |t| t.datetime "created_at", null: false