# 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: 2018_11_16_234032) do

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

  create_table "jukebox_list_songs", force: :cascade do |t|
    t.bigint "jukebox_list_id"
    t.bigint "song_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["jukebox_list_id"], name: "index_jukebox_list_songs_on_jukebox_list_id"
    t.index ["song_id"], name: "index_jukebox_list_songs_on_song_id"
  end

  create_table "jukebox_lists", force: :cascade do |t|
    t.string "location"
    t.bigint "user_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["user_id"], name: "index_jukebox_lists_on_user_id"
  end

  create_table "song_list_songs", force: :cascade do |t|
    t.bigint "song_list_id"
    t.bigint "song_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["song_id"], name: "index_song_list_songs_on_song_id"
    t.index ["song_list_id"], name: "index_song_list_songs_on_song_list_id"
  end

  create_table "song_lists", force: :cascade do |t|
    t.string "name"
    t.bigint "user_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["user_id"], name: "index_song_lists_on_user_id"
  end

  create_table "songs", force: :cascade do |t|
    t.string "name"
    t.string "genre"
    t.string "artist"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "users", force: :cascade do |t|
    t.string "first_name"
    t.string "last_name"
    t.string "username"
    t.string "password_digest"
    t.string "typeof"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_foreign_key "jukebox_list_songs", "jukebox_lists"
  add_foreign_key "jukebox_list_songs", "songs"
  add_foreign_key "jukebox_lists", "users"
  add_foreign_key "song_list_songs", "song_lists"
  add_foreign_key "song_list_songs", "songs"
  add_foreign_key "song_lists", "users"
end
