diff --git a/db/migrate/20141113164048_add_smile_count_to_answers.rb b/db/migrate/20141113164048_add_smile_count_to_answers.rb new file mode 100644 index 00000000..b3983533 --- /dev/null +++ b/db/migrate/20141113164048_add_smile_count_to_answers.rb @@ -0,0 +1,5 @@ +class AddSmileCountToAnswers < ActiveRecord::Migration + def change + add_column :answers, :smile_count, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20141113164314_add_smiled_count_to_users.rb b/db/migrate/20141113164314_add_smiled_count_to_users.rb new file mode 100644 index 00000000..9bd92879 --- /dev/null +++ b/db/migrate/20141113164314_add_smiled_count_to_users.rb @@ -0,0 +1,5 @@ +class AddSmiledCountToUsers < ActiveRecord::Migration + def change + add_column :users, :smiled_count, :integer, default: 0, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 7eda252e..2889ce66 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: 20141110210154) do +ActiveRecord::Schema.define(version: 20141113164314) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -24,6 +24,7 @@ ActiveRecord::Schema.define(version: 20141110210154) do t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" + t.integer "smile_count", default: 0, null: false end add_index "answers", ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at", using: :btree @@ -78,6 +79,7 @@ ActiveRecord::Schema.define(version: 20141110210154) do t.integer "answered_count", default: 0, null: false t.integer "commented_count", default: 0, null: false t.string "display_name" + t.integer "smiled_count", default: 0, null: false end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree