final/db/schema.rb

102 lines
3.5 KiB
Ruby
Raw Normal View History

2015-12-07 04:43:35 +08:00
# encoding: UTF-8
# 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.
2015-12-09 05:05:24 +08:00
ActiveRecord::Schema.define(version: 20151205174700) do
2015-12-07 04:43:35 +08:00
create_table "article_comments", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.integer "article_id"
t.integer "user_id"
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index "article_comments", ["article_id"], name: "index_article_comments_on_article_id"
add_index "article_comments", ["user_id"], name: "index_article_comments_on_user_id"
2015-12-07 04:43:35 +08:00
create_table "article_stars", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.integer "article_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index "article_stars", ["article_id", "user_id"], name: "index_article_stars_on_article_id_and_user_id"
2015-12-07 04:43:35 +08:00
create_table "article_views", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.integer "article_id"
t.integer "user_id"
t.string "ip"
t.text "param_string"
t.datetime "created_at"
t.datetime "updated_at"
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index "article_views", ["article_id", "ip", "created_at"], name: "index_article_views_on_article_id_and_ip_and_created_at"
2015-12-07 04:43:35 +08:00
create_table "articles", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.integer "user_id"
t.string "title"
t.string "tags"
t.text "content"
t.integer "view_count"
t.integer "star_count"
t.integer "comments_count"
t.datetime "created_at"
t.datetime "updated_at"
t.string "source"
t.integer "category_id"
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index "articles", ["comments_count"], name: "index_articles_on_comments_count"
add_index "articles", ["created_at"], name: "index_articles_on_created_at"
add_index "articles", ["star_count"], name: "index_articles_on_star_count"
add_index "articles", ["title"], name: "index_articles_on_title"
add_index "articles", ["user_id"], name: "index_articles_on_user_id"
add_index "articles", ["view_count"], name: "index_articles_on_view_count"
2015-12-07 04:43:35 +08:00
create_table "blog_infos", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.string "name"
t.string "blog_title"
t.string "email"
t.text "description"
2015-12-07 04:43:35 +08:00
end
create_table "categories", force: :cascade do |t|
2015-12-09 05:05:24 +08:00
t.string "name"
t.integer "articles_count"
t.datetime "created_at"
t.datetime "updated_at"
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index "categories", ["articles_count"], name: "index_categories_on_articles_count"
2015-12-07 04:43:35 +08:00
create_table "users", force: :cascade do |t|
t.string "username"
t.string "password_digest"
t.string "email"
t.boolean "admin"
t.datetime "last_login_time"
t.datetime "last_reply_time"
t.datetime "created_at"
t.datetime "updated_at"
2015-12-09 05:05:24 +08:00
t.string "nick_name"
t.string "avatar"
2015-12-07 04:43:35 +08:00
end
add_index "users", ["email"], name: "index_users_on_email"
2015-12-09 05:05:24 +08:00
add_index "users", ["nick_name"], name: "index_users_on_nick_name"
2015-12-07 04:43:35 +08:00
add_index "users", ["username"], name: "index_users_on_username"
end