57 lines
2.2 KiB
Ruby
57 lines
2.2 KiB
Ruby
# This file is auto-generated from the current state of the database. Instead
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
#
|
|
# Note that this schema.rb definition is the authoritative source for your
|
|
# database schema. If you need to create the application database on another
|
|
# system, you should be using db:schema:load, not running all the migrations
|
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
#
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
|
|
ActiveRecord::Schema.define(version: 2019_02_14_142704) do
|
|
|
|
create_table "articles", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
|
t.string "title"
|
|
t.text "post"
|
|
t.bigint "user_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["user_id"], name: "index_articles_on_user_id"
|
|
end
|
|
|
|
create_table "comments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
|
t.text "content"
|
|
t.bigint "article_id"
|
|
t.bigint "user_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["article_id"], name: "index_comments_on_article_id"
|
|
t.index ["user_id"], name: "index_comments_on_user_id"
|
|
end
|
|
|
|
create_table "user_profiles", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
|
t.string "avatar"
|
|
t.string "tagline"
|
|
t.date "dob"
|
|
t.string "role"
|
|
t.bigint "user_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["user_id"], name: "index_user_profiles_on_user_id"
|
|
end
|
|
|
|
create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "email"
|
|
t.string "password_digest"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
add_foreign_key "articles", "users"
|
|
add_foreign_key "comments", "articles"
|
|
add_foreign_key "comments", "users"
|
|
add_foreign_key "user_profiles", "users"
|
|
end
|