# 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 `bin/rails
# db:schema:load`. When creating a new database, `bin/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: 2021_04_12_203113) do

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

  create_table "activities", force: :cascade do |t|
    t.string "name", limit: 64, null: false
    t.string "about", limit: 1024, null: false
    t.string "photo", limit: 3145728
    t.date "date", null: false
    t.string "description", limit: 4096
  end

  create_table "activity_people", id: false, force: :cascade do |t|
    t.bigint "person_id", null: false
    t.bigint "activity_id", null: false
    t.string "position", limit: 32, null: false
    t.string "contribution", limit: 2048, null: false
  end

  create_table "auths", primary_key: "email", id: :string, force: :cascade do |t|
    t.integer "access", null: false
    t.bigint "people_id", null: false
    t.index ["people_id"], name: "index_auths_on_people_id"
  end

  create_table "people", force: :cascade do |t|
    t.string "surname", limit: 64, null: false
    t.string "name", limit: 64, null: false
    t.string "status", limit: 16, null: false
    t.string "faculty", limit: 6, null: false
    t.date "date_birth"
    t.string "year_in", limit: 4, null: false
    t.string "patronymic", limit: 64
    t.string "photo", limit: 3145728
    t.string "about", limit: 2048
    t.string "telephone", limit: 20
    t.string "email_address", limit: 64
    t.string "special", limit: 64
    t.string "year_out", limit: 4
    t.bigint "people_id"
    t.index ["people_id"], name: "index_people_on_people_id"
  end

  add_foreign_key "auths", "people", column: "people_id"
  add_foreign_key "people", "people", column: "people_id"
end
