2011-11-23 21:30:09 +00: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).
|
|
|
|
#
|
2013-09-10 19:29:17 +00:00
|
|
|
# It's strongly recommended that you check this file into your version control system.
|
2011-11-23 21:30:09 +00:00
|
|
|
|
2015-04-02 09:45:39 +00:00
|
|
|
ActiveRecord::Schema.define(version: 20150401161102) do
|
2014-02-09 13:44:09 +00:00
|
|
|
|
|
|
|
# These are extensions that must be enabled in order to support this database
|
|
|
|
enable_extension "plpgsql"
|
|
|
|
|
|
|
|
create_table "api_tokens", force: true do |t|
|
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.string "token", null: false
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2015-04-02 09:45:39 +00:00
|
|
|
t.datetime "revoked_at"
|
2014-02-09 13:44:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "api_tokens", ["token"], name: "index_api_tokens_on_token", using: :btree
|
|
|
|
add_index "api_tokens", ["user_id"], name: "index_api_tokens_on_user_id", using: :btree
|
2011-11-23 21:30:09 +00:00
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
create_table "asciicasts", force: true do |t|
|
2011-11-23 21:30:09 +00:00
|
|
|
t.integer "user_id"
|
|
|
|
t.string "title"
|
2013-09-10 19:29:17 +00:00
|
|
|
t.float "duration", null: false
|
2011-11-23 21:30:09 +00:00
|
|
|
t.string "terminal_type"
|
2013-09-10 19:29:17 +00:00
|
|
|
t.integer "terminal_columns", null: false
|
|
|
|
t.integer "terminal_lines", null: false
|
2011-11-23 21:30:09 +00:00
|
|
|
t.string "command"
|
|
|
|
t.string "shell"
|
|
|
|
t.string "uname"
|
2013-09-10 19:29:17 +00:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2013-08-04 20:39:55 +00:00
|
|
|
t.string "stdin_data"
|
2011-11-23 21:44:00 +00:00
|
|
|
t.string "stdin_timing"
|
2013-08-04 20:39:55 +00:00
|
|
|
t.string "stdout_data"
|
2011-11-23 21:44:00 +00:00
|
|
|
t.string "stdout_timing"
|
2012-03-11 13:44:01 +00:00
|
|
|
t.text "description"
|
2013-09-10 19:29:17 +00:00
|
|
|
t.boolean "featured", default: false
|
|
|
|
t.integer "likes_count", default: 0, null: false
|
2012-04-06 18:49:54 +00:00
|
|
|
t.text "snapshot"
|
2013-09-10 19:29:17 +00:00
|
|
|
t.integer "comments_count", default: 0, null: false
|
|
|
|
t.boolean "time_compression", default: true, null: false
|
|
|
|
t.integer "views_count", default: 0, null: false
|
|
|
|
t.string "stdout_frames"
|
2013-10-11 18:44:49 +00:00
|
|
|
t.string "user_agent"
|
2014-06-30 21:26:25 +00:00
|
|
|
t.string "theme_name"
|
2014-11-27 11:48:41 +00:00
|
|
|
t.float "snapshot_at"
|
2015-02-28 17:48:49 +00:00
|
|
|
t.integer "version", null: false
|
2015-02-27 13:58:04 +00:00
|
|
|
t.string "file"
|
2015-03-27 11:35:34 +00:00
|
|
|
t.string "image"
|
2015-03-27 17:33:50 +00:00
|
|
|
t.integer "image_width"
|
|
|
|
t.integer "image_height"
|
2014-11-15 17:46:46 +00:00
|
|
|
t.string "secret_token", null: false
|
|
|
|
t.boolean "private", default: false, null: false
|
2011-11-23 21:30:09 +00:00
|
|
|
end
|
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
add_index "asciicasts", ["created_at"], name: "index_asciicasts_on_created_at", using: :btree
|
|
|
|
add_index "asciicasts", ["featured"], name: "index_asciicasts_on_featured", using: :btree
|
|
|
|
add_index "asciicasts", ["likes_count"], name: "index_asciicasts_on_likes_count", using: :btree
|
2014-11-15 17:46:46 +00:00
|
|
|
add_index "asciicasts", ["private"], name: "index_asciicasts_on_private", using: :btree
|
|
|
|
add_index "asciicasts", ["secret_token"], name: "index_asciicasts_on_secret_token", unique: true, using: :btree
|
2013-09-10 19:29:17 +00:00
|
|
|
add_index "asciicasts", ["user_id"], name: "index_asciicasts_on_user_id", using: :btree
|
|
|
|
add_index "asciicasts", ["views_count"], name: "index_asciicasts_on_views_count", using: :btree
|
2012-03-04 17:14:58 +00:00
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
create_table "comments", force: true do |t|
|
|
|
|
t.text "body", null: false
|
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.integer "asciicast_id", null: false
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2012-03-04 20:26:22 +00:00
|
|
|
end
|
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
add_index "comments", ["asciicast_id", "created_at"], name: "index_comments_on_asciicast_id_and_created_at", using: :btree
|
|
|
|
add_index "comments", ["asciicast_id"], name: "index_comments_on_asciicast_id", using: :btree
|
|
|
|
add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
|
2012-03-04 20:26:22 +00:00
|
|
|
|
2014-10-04 17:56:16 +00:00
|
|
|
create_table "expiring_tokens", force: true do |t|
|
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.string "token", null: false
|
|
|
|
t.datetime "expires_at", null: false
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "used_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "expiring_tokens", ["used_at", "expires_at", "token"], name: "index_expiring_tokens_on_used_at_and_expires_at_and_token", using: :btree
|
|
|
|
add_index "expiring_tokens", ["user_id"], name: "index_expiring_tokens_on_user_id", using: :btree
|
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
create_table "likes", force: true do |t|
|
|
|
|
t.integer "asciicast_id", null: false
|
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2012-04-06 12:06:40 +00:00
|
|
|
end
|
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
add_index "likes", ["asciicast_id"], name: "index_likes_on_asciicast_id", using: :btree
|
|
|
|
add_index "likes", ["user_id", "asciicast_id"], name: "index_likes_on_user_id_and_asciicast_id", using: :btree
|
|
|
|
add_index "likes", ["user_id"], name: "index_likes_on_user_id", using: :btree
|
2012-04-06 12:06:40 +00:00
|
|
|
|
2013-09-10 19:29:17 +00:00
|
|
|
create_table "users", force: true do |t|
|
2013-10-19 18:59:39 +00:00
|
|
|
t.string "provider"
|
|
|
|
t.string "uid"
|
2012-02-25 16:30:42 +00:00
|
|
|
t.string "email"
|
|
|
|
t.string "name"
|
2014-10-05 15:47:42 +00:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "username"
|
2013-10-22 17:16:18 +00:00
|
|
|
t.string "auth_token"
|
2014-06-30 21:26:25 +00:00
|
|
|
t.string "theme_name"
|
2014-10-05 15:47:42 +00:00
|
|
|
t.string "temporary_username"
|
2012-02-25 16:30:42 +00:00
|
|
|
end
|
|
|
|
|
2013-10-22 17:16:18 +00:00
|
|
|
add_index "users", ["auth_token"], name: "index_users_on_auth_token", using: :btree
|
2013-10-22 17:17:34 +00:00
|
|
|
add_index "users", ["email"], name: "index_users_on_email", using: :btree
|
2013-09-10 19:29:17 +00:00
|
|
|
add_index "users", ["provider", "uid"], name: "index_users_on_provider_and_uid", unique: true, using: :btree
|
2014-02-12 19:51:01 +00:00
|
|
|
add_index "users", ["username"], name: "index_users_on_username", using: :btree
|
2012-02-25 16:30:42 +00:00
|
|
|
|
2015-03-11 09:47:02 +00:00
|
|
|
add_foreign_key "api_tokens", "users", name: "api_tokens_user_id_fk"
|
|
|
|
|
|
|
|
add_foreign_key "asciicasts", "users", name: "asciicasts_user_id_fk"
|
|
|
|
|
|
|
|
add_foreign_key "comments", "asciicasts", name: "comments_asciicast_id_fk"
|
|
|
|
add_foreign_key "comments", "users", name: "comments_user_id_fk"
|
|
|
|
|
|
|
|
add_foreign_key "expiring_tokens", "users", name: "expiring_tokens_user_id_fk"
|
|
|
|
|
|
|
|
add_foreign_key "likes", "asciicasts", name: "likes_asciicast_id_fk"
|
|
|
|
add_foreign_key "likes", "users", name: "likes_user_id_fk"
|
|
|
|
|
2011-11-23 21:30:09 +00:00
|
|
|
end
|