forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.rb
112 lines (101 loc) · 5 KB
/
schema.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# 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: 2020_04_23_204147) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "all_casa_admins", 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", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["email"], name: "index_all_casa_admins_on_email", unique: true
t.index ["reset_password_token"], name: "index_all_casa_admins_on_reset_password_token", unique: true
end
create_table "casa_cases", force: :cascade do |t|
t.string "case_number", null: false
t.boolean "transition_aged_youth", default: false, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["case_number"], name: "index_casa_cases_on_case_number", unique: true
end
create_table "casa_orgs", force: :cascade do |t|
t.string "name", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "case_assignments", force: :cascade do |t|
t.bigint "casa_case_id", null: false
t.bigint "volunteer_id", null: false
t.boolean "is_active", default: true, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["casa_case_id"], name: "index_case_assignments_on_casa_case_id"
t.index ["volunteer_id"], name: "index_case_assignments_on_volunteer_id"
end
create_table "case_contacts", force: :cascade do |t|
t.bigint "creator_id", null: false
t.bigint "casa_case_id", null: false
t.string "other_type_text"
t.integer "duration_minutes", null: false
t.datetime "occurred_at", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.boolean "contact_made", default: false
t.string "medium_type"
t.string "contact_types", array: true
t.index ["casa_case_id"], name: "index_case_contacts_on_casa_case_id"
t.index ["contact_types"], name: "index_case_contacts_on_contact_types", using: :gin
t.index ["creator_id"], name: "index_case_contacts_on_creator_id"
end
create_table "supervisor_volunteers", force: :cascade do |t|
t.bigint "supervisor_id", null: false
t.bigint "volunteer_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["supervisor_id"], name: "index_supervisor_volunteers_on_supervisor_id"
t.index ["volunteer_id"], name: "index_supervisor_volunteers_on_volunteer_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", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "role", default: "volunteer", null: false
t.bigint "casa_org_id", null: false
t.string "display_name", default: ""
t.index ["casa_org_id"], name: "index_users_on_casa_org_id"
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 "versions", force: :cascade do |t|
t.string "item_type", null: false
t.bigint "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
end
add_foreign_key "case_assignments", "casa_cases"
add_foreign_key "case_assignments", "users", column: "volunteer_id"
add_foreign_key "case_contacts", "casa_cases"
add_foreign_key "case_contacts", "users", column: "creator_id"
add_foreign_key "supervisor_volunteers", "users", column: "supervisor_id"
add_foreign_key "supervisor_volunteers", "users", column: "volunteer_id"
add_foreign_key "users", "casa_orgs"
end