mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
Add comment model and its tests
This commit is contained in:
17
db/schema.rb
17
db/schema.rb
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user