Add comment model and its tests

This commit is contained in:
riggraz
2019-09-16 16:05:00 +02:00
parent b3fefe77ee
commit 3f4eba70d7
5 changed files with 94 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_08_26_154118) do
ActiveRecord::Schema.define(version: 2019_09_16_131938) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -23,6 +23,18 @@ ActiveRecord::Schema.define(version: 2019_08_26_154118) do
t.index ["name"], name: "index_boards_on_name", unique: true
end
create_table "comments", force: :cascade do |t|
t.text "body"
t.bigint "user_id", null: false
t.bigint "post_id", null: false
t.bigint "parent_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["parent_id"], name: "index_comments_on_parent_id"
t.index ["post_id"], name: "index_comments_on_post_id"
t.index ["user_id"], name: "index_comments_on_user_id"
end
create_table "post_statuses", force: :cascade do |t|
t.string "name", null: false
t.string "color", null: false
@@ -65,6 +77,9 @@ ActiveRecord::Schema.define(version: 2019_08_26_154118) do
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
add_foreign_key "comments", "comments", column: "parent_id"
add_foreign_key "comments", "posts"
add_foreign_key "comments", "users"
add_foreign_key "posts", "boards"
add_foreign_key "posts", "post_statuses"
add_foreign_key "posts", "users"