obdev/db/schema.rb

259 lines
8.6 KiB
Ruby

# 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[7.1].define(version: 2024_04_29_184834) do
create_table "access_periods", force: :cascade do |t|
t.date "start_date"
t.date "end_date"
t.integer "user_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_access_periods_on_user_id"
end
create_table "bank_accounts", force: :cascade do |t|
t.string "institution_name"
t.string "account_type"
t.string "routing_number"
t.string "account_number"
t.date "start_date"
t.date "end_date"
t.string "owner_type", null: false
t.integer "owner_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["owner_type", "owner_id"], name: "index_bank_accounts_on_owner"
end
create_table "employer_records", force: :cascade do |t|
t.integer "participant_id", null: false
t.integer "employer_id", null: false
t.date "start_date"
t.date "end_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_employer_records_on_employer_id"
t.index ["participant_id"], name: "index_employer_records_on_participant_id"
end
create_table "employers", force: :cascade do |t|
t.string "first_name"
t.string "phone"
t.string "email"
t.string "tin"
t.date "dob"
t.string "ssn"
t.string "gender"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "last_name"
t.string "address_line_1"
t.string "address_line_2"
t.string "city"
t.string "state"
t.string "zip"
t.index ["ssn"], name: "index_employers_on_ssn", unique: true
t.index ["tin"], name: "index_employers_on_tin", unique: true
end
create_table "employers_vendors", id: false, force: :cascade do |t|
t.integer "vendor_id", null: false
t.integer "employer_id", null: false
end
create_table "employments", force: :cascade do |t|
t.integer "worker_id", null: false
t.integer "participant_id", null: false
t.date "start_date"
t.date "end_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["participant_id"], name: "index_employments_on_participant_id"
t.index ["worker_id"], name: "index_employments_on_worker_id"
end
create_table "form_roles", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "forms", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.boolean "required"
t.string "program"
t.string "role"
end
create_table "forms_roles", force: :cascade do |t|
t.integer "form_id", null: false
t.integer "form_role_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "note"
t.date "date_completed"
t.index ["form_id"], name: "index_forms_roles_on_form_id"
t.index ["form_role_id"], name: "index_forms_roles_on_form_role_id"
end
create_table "onboarding_items", force: :cascade do |t|
t.integer "form_id"
t.text "note"
t.date "date_completed"
t.string "owner_type", null: false
t.integer "owner_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["owner_type", "owner_id"], name: "index_onboarding_items_on_owner"
end
create_table "participants", force: :cascade do |t|
t.string "first_name"
t.string "phone"
t.string "email"
t.string "mci"
t.date "dob"
t.string "ssn"
t.string "gender"
t.integer "employer_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "worker_id"
t.string "last_name"
t.string "address_line_1"
t.string "address_line_2"
t.string "city"
t.string "state"
t.string "zip"
t.date "start_date"
t.date "end_date"
t.index ["employer_id"], name: "index_participants_on_employer_id"
t.index ["worker_id"], name: "index_participants_on_worker_id"
end
create_table "participants_programs", id: false, force: :cascade do |t|
t.integer "participant_id", null: false
t.integer "program_id", null: false
end
create_table "participants_vendors", id: false, force: :cascade do |t|
t.integer "vendor_id", null: false
t.integer "participant_id", null: false
end
create_table "programs", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "roles", force: :cascade do |t|
t.string "name"
t.string "resource_type"
t.integer "resource_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
t.index ["name"], name: "index_roles_on_name"
t.index ["resource_type", "resource_id"], name: "index_roles_on_resource"
end
create_table "service_contracts", force: :cascade do |t|
t.integer "participant_id", null: false
t.integer "vendor_id", null: false
t.date "start_date"
t.date "end_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["participant_id"], name: "index_service_contracts_on_participant_id"
t.index ["vendor_id"], name: "index_service_contracts_on_vendor_id"
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_name"
t.string "last_name"
t.string "phone"
t.string "company"
t.boolean "access_revoked", default: false
t.date "access_start_date"
t.date "access_end_date"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "users_roles", id: false, force: :cascade do |t|
t.integer "user_id"
t.integer "role_id"
t.index ["role_id"], name: "index_users_roles_on_role_id"
t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
t.index ["user_id"], name: "index_users_roles_on_user_id"
end
create_table "vendors", force: :cascade do |t|
t.string "name"
t.string "phone"
t.string "email"
t.string "dba"
t.string "tin"
t.string "contact_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "contact"
t.string "address_line_1"
t.string "address_line_2"
t.string "city"
t.string "state"
t.string "zip"
t.index ["tin"], name: "index_vendors_on_tin", unique: true
end
create_table "workers", force: :cascade do |t|
t.string "name"
t.string "phone"
t.string "email"
t.date "dob"
t.string "ssn"
t.string "gender"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_name"
t.string "last_name"
t.string "address_line_1"
t.string "address_line_2"
t.string "city"
t.string "state"
t.string "zip"
t.index ["ssn"], name: "index_workers_on_ssn", unique: true
end
add_foreign_key "access_periods", "users"
add_foreign_key "employer_records", "employers"
add_foreign_key "employer_records", "participants"
add_foreign_key "employments", "participants"
add_foreign_key "employments", "workers"
add_foreign_key "forms_roles", "form_roles"
add_foreign_key "forms_roles", "forms"
add_foreign_key "participants", "employers"
add_foreign_key "participants", "workers"
add_foreign_key "service_contracts", "participants"
add_foreign_key "service_contracts", "vendors"
end