# 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.

ActiveRecord::Schema.define(version: 20160604072548) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "players", force: :cascade do |t|
    t.string   "status",     default: "stopped", null: false
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
    t.integer  "video_id"
    t.integer  "team_id"
  end

  add_index "players", ["status"], name: "index_players_on_status", using: :btree
  add_index "players", ["team_id"], name: "index_players_on_team_id", using: :btree
  add_index "players", ["video_id"], name: "index_players_on_video_id", using: :btree

  create_table "playlists", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "team_id"
  end

  add_index "playlists", ["team_id"], name: "index_playlists_on_team_id", using: :btree

  create_table "teams", force: :cascade do |t|
    t.string   "slack_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "teams", ["slack_id"], name: "index_teams_on_slack_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "slack_id"
    t.string   "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "team_id"
    t.integer  "position"
  end

  add_index "users", ["position"], name: "index_users_on_position", using: :btree
  add_index "users", ["team_id"], name: "index_users_on_team_id", using: :btree

  create_table "videos", force: :cascade do |t|
    t.string   "url"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
    t.string   "youtube_id"
    t.datetime "played_at"
    t.integer  "playlist_id"
    t.integer  "user_id"
    t.string   "title"
  end

  add_index "videos", ["playlist_id"], name: "index_videos_on_playlist_id", using: :btree
  add_index "videos", ["user_id"], name: "index_videos_on_user_id", using: :btree
  add_index "videos", ["youtube_id"], name: "index_videos_on_youtube_id", using: :btree

end
