Episodes
# 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.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_12_23_033409) do

  create_table "automobile_parts", force: :cascade do |t|
    t.integer "automobile_id", null: false
    t.integer "part_id", null: false
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["automobile_id"], name: "index_automobile_parts_on_automobile_id"
    t.index ["part_id"], name: "index_automobile_parts_on_part_id"
  end

  create_table "automobiles", force: :cascade do |t|
    t.integer "manufacture_id", null: false
    t.string "name"
    t.integer "year", limit: 4
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["manufacture_id"], name: "index_automobiles_on_manufacture_id"
    t.index ["name"], name: "index_automobiles_on_name", unique: true
  end

  create_table "manufactures", force: :cascade do |t|
    t.string "name"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["name"], name: "index_manufactures_on_name", unique: true
  end

  create_table "parts", force: :cascade do |t|
    t.string "name"
    t.decimal "price", precision: 8, scale: 2
    t.decimal "weight", precision: 8, scale: 2
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["name"], name: "index_parts_on_name", unique: true
  end

  create_table "recalls", force: :cascade do |t|
    t.integer "part_id", null: false
    t.string "description"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["part_id"], name: "index_recalls_on_part_id"
  end

  add_foreign_key "automobile_parts", "automobiles"
  add_foreign_key "automobile_parts", "parts"
  add_foreign_key "automobiles", "manufactures"
  add_foreign_key "recalls", "parts"
end