From acbdf895f334695666c353c7d32f5a93d7b762e7 Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 3 Nov 2015 18:59:17 +0100 Subject: [PATCH] makes confidence score non-nullable and default to 0 in comments --- ...1103175139_make_comments_confidence_score_default_to_0.rb | 5 +++++ db/schema.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb diff --git a/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb b/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb new file mode 100644 index 000000000..788601c44 --- /dev/null +++ b/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb @@ -0,0 +1,5 @@ +class MakeCommentsConfidenceScoreDefaultTo0 < ActiveRecord::Migration + def change + change_column :comments, :confidence_score, :integer, default: 0, null: false, index: true + end +end diff --git a/db/schema.rb b/db/schema.rb index cbe2fd671..320bfffc1 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: 20151030182217) do +ActiveRecord::Schema.define(version: 20151103175139) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -75,7 +75,7 @@ ActiveRecord::Schema.define(version: 20151030182217) do t.integer "cached_votes_down", default: 0 t.datetime "confirmed_hide_at" t.string "ancestry" - t.integer "confidence_score" + t.integer "confidence_score", default: 0, null: false end add_index "comments", ["ancestry"], name: "index_comments_on_ancestry", using: :btree