schema.rb 35.1 KB
Newer Older
Tugce Nur Tas's avatar
Tugce Nur Tas committed
1
2
3
4
5
6
7
8
9
10
11
12
# 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.

13
ActiveRecord::Schema.define(version: 20181004163636) do
Tugce Nur Tas's avatar
Tugce Nur Tas committed
14
15
16
17

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

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
  create_table "assignment_logs", force: :cascade do |t|
    t.bigint "assignment_id"
    t.bigint "volunteer_id"
    t.bigint "client_id"
    t.bigint "creator_id"
    t.bigint "period_end_set_by_id"
    t.bigint "termination_submitted_by_id"
    t.bigint "termination_verified_by_id"
    t.date "period_start"
    t.date "period_end"
    t.datetime "performance_appraisal_review"
    t.datetime "probation_period"
    t.datetime "home_visit"
    t.datetime "first_instruction_lesson"
    t.datetime "progress_meeting"
    t.string "short_description"
    t.text "goals"
    t.text "starting_topic"
    t.text "description"
    t.string "kind", default: "accompaniment"
    t.datetime "submitted_at"
    t.datetime "termination_submitted_at"
    t.datetime "termination_verified_at"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
44
45
46
47
    t.text "term_feedback_activities"
    t.text "term_feedback_success"
    t.text "term_feedback_problems"
    t.text "term_feedback_transfair"
48
49
    t.text "comments"
    t.text "additional_comments"
Emily Wangler's avatar
Emily Wangler committed
50
51
52
53
54
55
56
    t.string "assignment_description"
    t.string "first_meeting"
    t.string "frequency"
    t.string "trial_period_end"
    t.string "duration"
    t.string "special_agreement"
    t.text "agreement_text"
57
    t.bigint "submitted_by_id"
58
59
60
61
    t.index ["assignment_id"], name: "index_assignment_logs_on_assignment_id"
    t.index ["client_id"], name: "index_assignment_logs_on_client_id"
    t.index ["creator_id"], name: "index_assignment_logs_on_creator_id"
    t.index ["deleted_at"], name: "index_assignment_logs_on_deleted_at"
62
    t.index ["period_end"], name: "index_assignment_logs_on_period_end"
63
    t.index ["period_end_set_by_id"], name: "index_assignment_logs_on_period_end_set_by_id"
64
65
    t.index ["period_start"], name: "index_assignment_logs_on_period_start"
    t.index ["submitted_at"], name: "index_assignment_logs_on_submitted_at"
66
    t.index ["submitted_by_id"], name: "index_assignment_logs_on_submitted_by_id"
67
    t.index ["termination_submitted_at"], name: "index_assignment_logs_on_termination_submitted_at"
68
    t.index ["termination_submitted_by_id"], name: "index_assignment_logs_on_termination_submitted_by_id"
69
    t.index ["termination_verified_at"], name: "index_assignment_logs_on_termination_verified_at"
70
71
72
73
    t.index ["termination_verified_by_id"], name: "index_assignment_logs_on_termination_verified_by_id"
    t.index ["volunteer_id"], name: "index_assignment_logs_on_volunteer_id"
  end

Andi Staub's avatar
Andi Staub committed
74
75
76
77
78
79
  create_table "assignments", force: :cascade do |t|
    t.bigint "client_id"
    t.bigint "volunteer_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
80
    t.bigint "creator_id"
81
82
    t.date "period_start"
    t.date "period_end"
83
84
85
    t.datetime "performance_appraisal_review"
    t.datetime "probation_period"
    t.datetime "home_visit"
86
    t.datetime "first_instruction_lesson"
87
88
89
90
91
    t.datetime "progress_meeting"
    t.string "short_description"
    t.text "goals"
    t.text "starting_topic"
    t.text "description"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
92
    t.string "kind", default: "accompaniment"
93
    t.datetime "submitted_at"
94
95
96
97
98
    t.bigint "period_end_set_by_id"
    t.datetime "termination_submitted_at"
    t.bigint "termination_submitted_by_id"
    t.datetime "termination_verified_at"
    t.bigint "termination_verified_by_id"
99
100
101
102
    t.text "term_feedback_activities"
    t.text "term_feedback_success"
    t.text "term_feedback_problems"
    t.text "term_feedback_transfair"
103
104
    t.text "comments"
    t.text "additional_comments"
Emily Wangler's avatar
Emily Wangler committed
105
106
107
108
109
110
    t.string "assignment_description"
    t.string "first_meeting"
    t.string "frequency"
    t.string "trial_period_end"
    t.string "duration"
    t.string "special_agreement"
111
    t.text "agreement_text", default: "Freiwillige beachten folgende Grundsätze während ihres Einsatzes in der AOZ:\n* Verhaltenskodex für Freiwillige\n* Rechte und Pflichten für Freiwillige\n* AOZ Leitlinien Praktische Integrationsarbeit\n\nAllenfalls auch\n* Verpflichtungserklärung zum Schutz der unbegleiteten minderjährigen Asylsuchenden (MNA)\n* Niederschwellige Gratis-Deutschkurse: Informationen für freiwillige Kursleitende\n"
112
113
114
115
    t.string "pdf_file_name"
    t.string "pdf_content_type"
    t.integer "pdf_file_size"
    t.datetime "pdf_updated_at"
116
    t.bigint "submitted_by_id"
Andi Staub's avatar
Andi Staub committed
117
    t.index ["client_id"], name: "index_assignments_on_client_id"
118
    t.index ["creator_id"], name: "index_assignments_on_creator_id"
119
    t.index ["period_end"], name: "index_assignments_on_period_end"
120
    t.index ["period_end_set_by_id"], name: "index_assignments_on_period_end_set_by_id"
121
122
    t.index ["period_start"], name: "index_assignments_on_period_start"
    t.index ["submitted_at"], name: "index_assignments_on_submitted_at"
123
    t.index ["submitted_by_id"], name: "index_assignments_on_submitted_by_id"
124
    t.index ["termination_submitted_at"], name: "index_assignments_on_termination_submitted_at"
125
    t.index ["termination_submitted_by_id"], name: "index_assignments_on_termination_submitted_by_id"
126
    t.index ["termination_verified_at"], name: "index_assignments_on_termination_verified_at"
127
    t.index ["termination_verified_by_id"], name: "index_assignments_on_termination_verified_by_id"
Andi Staub's avatar
Andi Staub committed
128
129
130
    t.index ["volunteer_id"], name: "index_assignments_on_volunteer_id"
  end

Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
131
132
  create_table "billing_expenses", force: :cascade do |t|
    t.integer "amount"
133
134
    t.string "bank"
    t.string "iban"
135
136
137
138
139
    t.bigint "volunteer_id"
    t.bigint "user_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
140
    t.integer "overwritten_amount"
141
142
143
144
145
146
    t.index ["deleted_at"], name: "index_billing_expenses_on_deleted_at"
    t.index ["user_id"], name: "index_billing_expenses_on_user_id"
    t.index ["volunteer_id"], name: "index_billing_expenses_on_volunteer_id"
  end

  create_table "certificates", force: :cascade do |t|
147
148
149
150
    t.integer "hours"
    t.date "duration_start"
    t.date "duration_end"
    t.text "institution"
151
    t.text "text_body"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
152
    t.string "function"
153
    t.jsonb "volunteer_contact"
154
    t.jsonb "assignment_kinds"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
155
    t.bigint "volunteer_id"
156
    t.bigint "user_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
157
158
159
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
160
161
    t.string "creator_name"
    t.string "creator_function"
162
163
164
    t.index ["deleted_at"], name: "index_certificates_on_deleted_at"
    t.index ["user_id"], name: "index_certificates_on_user_id"
    t.index ["volunteer_id"], name: "index_certificates_on_volunteer_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
165
166
  end

167
168
169
170
171
172
173
174
175
176
177
  create_table "client_notifications", force: :cascade do |t|
    t.text "body"
    t.bigint "user_id"
    t.boolean "active"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["deleted_at"], name: "index_client_notifications_on_deleted_at"
    t.index ["user_id"], name: "index_client_notifications_on_user_id"
  end

178
  create_table "clients", force: :cascade do |t|
179
    t.date "birth_year"
180
181
    t.string "nationality"
    t.string "permit"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
182
    t.string "salutation"
183
184
185
186
    t.text "goals"
    t.text "education"
    t.text "interests"
    t.text "comments"
187
    t.text "competent_authority"
188
189
190
    t.bigint "user_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Tugce Nur Tas's avatar
Tugce Nur Tas committed
191
    t.datetime "deleted_at"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
192
193
194
    t.string "gender_request"
    t.string "age_request"
    t.string "other_request"
195
    t.text "actual_activities"
196
197
198
199
200
201
202
    t.boolean "flexible", default: false
    t.boolean "morning", default: false
    t.boolean "afternoon", default: false
    t.boolean "evening", default: false
    t.boolean "workday", default: false
    t.boolean "weekend", default: false
    t.text "detailed_description"
203
    t.string "entry_date"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
204
    t.integer "acceptance", default: 0
205
    t.integer "cost_unit"
206
    t.bigint "involved_authority_id"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
207
    t.bigint "resigned_by_id"
208
209
210
    t.datetime "resigned_at"
    t.datetime "accepted_at"
    t.datetime "rejected_at"
211
    t.text "additional_comments"
212
213
214
    t.index ["acceptance"], name: "index_clients_on_acceptance"
    t.index ["accepted_at"], name: "index_clients_on_accepted_at"
    t.index ["birth_year"], name: "index_clients_on_birth_year"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
215
    t.index ["deleted_at"], name: "index_clients_on_deleted_at"
216
    t.index ["involved_authority_id"], name: "index_clients_on_involved_authority_id"
217
218
219
    t.index ["nationality"], name: "index_clients_on_nationality"
    t.index ["rejected_at"], name: "index_clients_on_rejected_at"
    t.index ["resigned_at"], name: "index_clients_on_resigned_at"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
220
    t.index ["resigned_by_id"], name: "index_clients_on_resigned_by_id"
221
    t.index ["salutation"], name: "index_clients_on_salutation"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
222
    t.index ["user_id"], name: "index_clients_on_user_id"
223
224
  end

Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
225
226
  create_table "contacts", force: :cascade do |t|
    t.string "street"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
227
    t.string "extended"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
228
    t.string "postal_code"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
229
    t.string "city"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
230
231
232
233
234
    t.string "contactable_type"
    t.bigint "contactable_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.datetime "deleted_at"
235
236
    t.string "first_name"
    t.string "last_name"
237
238
    t.string "primary_email"
    t.string "primary_phone"
239
    t.string "secondary_phone"
240
    t.boolean "external", default: false
241
    t.string "full_name"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
242
243
    t.index ["contactable_type", "contactable_id"], name: "index_contacts_on_contactable_type_and_contactable_id"
    t.index ["deleted_at"], name: "index_contacts_on_deleted_at"
244
    t.index ["external"], name: "index_contacts_on_external"
245
    t.index ["full_name"], name: "index_contacts_on_full_name"
246
    t.index ["postal_code"], name: "index_contacts_on_postal_code"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
  end

  create_table "departments", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.datetime "deleted_at"
    t.index ["deleted_at"], name: "index_departments_on_deleted_at"
  end

  create_table "departments_users", id: false, force: :cascade do |t|
    t.bigint "user_id", null: false
    t.bigint "department_id", null: false
    t.index ["department_id", "user_id"], name: "index_departments_users_on_department_id_and_user_id"
  end

Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
262
263
264
  create_table "email_templates", force: :cascade do |t|
    t.string "subject"
    t.text "body"
265
    t.integer "kind", default: 0
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
266
267
268
269
270
271
272
    t.boolean "active"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["deleted_at"], name: "index_email_templates_on_deleted_at"
  end

Tugce Nur Tas's avatar
Tugce Nur Tas committed
273
274
275
  create_table "event_volunteers", force: :cascade do |t|
    t.bigint "volunteer_id"
    t.bigint "event_id"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
276
    t.bigint "creator_id"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
277
278
279
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Tugce Nur Tas's avatar
Tugce Nur Tas committed
280
    t.index ["creator_id"], name: "index_event_volunteers_on_creator_id"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
281
282
283
284
285
    t.index ["deleted_at"], name: "index_event_volunteers_on_deleted_at"
    t.index ["event_id"], name: "index_event_volunteers_on_event_id"
    t.index ["volunteer_id"], name: "index_event_volunteers_on_volunteer_id"
  end

Tugce Nur Tas's avatar
Tugce Nur Tas committed
286
  create_table "events", force: :cascade do |t|
287
    t.integer "kind", null: false
Tugce Nur Tas's avatar
Tugce Nur Tas committed
288
289
290
291
292
293
294
295
296
297
    t.date "date"
    t.time "start_time"
    t.time "end_time"
    t.string "title"
    t.text "description"
    t.bigint "department_id"
    t.bigint "creator_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
298
    t.string "speaker"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
299
300
301
302
303
    t.index ["creator_id"], name: "index_events_on_creator_id"
    t.index ["deleted_at"], name: "index_events_on_deleted_at"
    t.index ["department_id"], name: "index_events_on_department_id"
  end

304
305
306
307
308
309
310
311
312
313
314
315
316
  create_table "feedbacks", force: :cascade do |t|
    t.text "goals"
    t.text "achievements"
    t.text "future"
    t.text "comments"
    t.boolean "conversation"
    t.datetime "deleted_at"
    t.bigint "volunteer_id"
    t.bigint "author_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "feedbackable_type"
    t.bigint "feedbackable_id"
317
    t.bigint "reviewer_id"
318
319
    t.bigint "responsible_id"
    t.datetime "responsible_at"
320
321
322
    t.index ["author_id"], name: "index_feedbacks_on_author_id"
    t.index ["deleted_at"], name: "index_feedbacks_on_deleted_at"
    t.index ["feedbackable_type", "feedbackable_id"], name: "index_feedbacks_on_feedbackable_type_and_feedbackable_id"
323
    t.index ["responsible_id"], name: "index_feedbacks_on_responsible_id"
324
    t.index ["reviewer_id"], name: "index_feedbacks_on_reviewer_id"
325
326
327
    t.index ["volunteer_id"], name: "index_feedbacks_on_volunteer_id"
  end

Chrysanthi Lagodimou's avatar
logs    
Chrysanthi Lagodimou committed
328
329
330
331
332
  create_table "group_assignment_logs", force: :cascade do |t|
    t.bigint "group_offer_id"
    t.bigint "volunteer_id"
    t.bigint "group_assignment_id"
    t.string "title"
333
334
    t.date "period_start"
    t.date "period_end"
Chrysanthi Lagodimou's avatar
logs    
Chrysanthi Lagodimou committed
335
336
    t.boolean "responsible", default: false
    t.datetime "deleted_at"
337
338
339
340
341
    t.bigint "period_end_set_by_id"
    t.bigint "termination_submitted_by_id"
    t.bigint "termination_verified_by_id"
    t.datetime "termination_submitted_at"
    t.datetime "termination_verified_at"
342
343
344
    t.datetime "submitted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
345
346
347
348
    t.text "term_feedback_activities"
    t.text "term_feedback_success"
    t.text "term_feedback_problems"
    t.text "term_feedback_transfair"
349
350
    t.text "comments"
    t.text "additional_comments"
Emily Wangler's avatar
Emily Wangler committed
351
352
353
354
355
356
    t.string "place"
    t.text "description"
    t.string "happens_at"
    t.string "frequency"
    t.string "trial_period_end"
    t.text "agreement_text"
357
    t.bigint "submitted_by_id"
Chrysanthi Lagodimou's avatar
logs    
Chrysanthi Lagodimou committed
358
359
360
    t.index ["deleted_at"], name: "index_group_assignment_logs_on_deleted_at"
    t.index ["group_assignment_id"], name: "index_group_assignment_logs_on_group_assignment_id"
    t.index ["group_offer_id"], name: "index_group_assignment_logs_on_group_offer_id"
361
    t.index ["period_end_set_by_id"], name: "index_group_assignment_logs_on_period_end_set_by_id"
362
    t.index ["submitted_by_id"], name: "index_group_assignment_logs_on_submitted_by_id"
363
364
    t.index ["termination_submitted_by_id"], name: "index_group_assignment_logs_on_termination_submitted_by_id"
    t.index ["termination_verified_by_id"], name: "index_group_assignment_logs_on_termination_verified_by_id"
Chrysanthi Lagodimou's avatar
logs    
Chrysanthi Lagodimou committed
365
366
367
368
    t.index ["title"], name: "index_group_assignment_logs_on_title"
    t.index ["volunteer_id"], name: "index_group_assignment_logs_on_volunteer_id"
  end

369
370
371
  create_table "group_assignments", force: :cascade do |t|
    t.bigint "group_offer_id"
    t.bigint "volunteer_id"
372
373
    t.date "period_start"
    t.date "period_end"
374
375
    t.boolean "responsible", default: false
    t.datetime "deleted_at"
376
    t.datetime "submitted_at"
377
378
379
380
381
    t.bigint "period_end_set_by_id"
    t.bigint "termination_submitted_by_id"
    t.bigint "termination_verified_by_id"
    t.datetime "termination_submitted_at"
    t.datetime "termination_verified_at"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
382
383
384
385
    t.text "term_feedback_activities"
    t.text "term_feedback_success"
    t.text "term_feedback_problems"
    t.text "term_feedback_transfair"
386
387
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
388
389
    t.text "comments"
    t.text "additional_comments"
Emily Wangler's avatar
Emily Wangler committed
390
391
392
393
394
    t.string "place"
    t.text "description"
    t.string "happens_at"
    t.string "frequency"
    t.string "trial_period_end"
395
    t.text "agreement_text", default: "Freiwillige beachten folgende Grundsätze während ihres Einsatzes in der AOZ:\n* Verhaltenskodex für Freiwillige\n* Rechte und Pflichten für Freiwillige\n* AOZ Leitlinien Praktische Integrationsarbeit\n\nAllenfalls auch\n* Verpflichtungserklärung zum Schutz der unbegleiteten minderjährigen Asylsuchenden (MNA)\n* Niederschwellige Gratis-Deutschkurse: Informationen für freiwillige Kursleitende\n"
396
397
398
399
    t.string "pdf_file_name"
    t.string "pdf_content_type"
    t.integer "pdf_file_size"
    t.datetime "pdf_updated_at"
400
    t.bigint "submitted_by_id"
401
402
    t.index ["deleted_at"], name: "index_group_assignments_on_deleted_at"
    t.index ["group_offer_id"], name: "index_group_assignments_on_group_offer_id"
403
    t.index ["period_end"], name: "index_group_assignments_on_period_end"
404
    t.index ["period_end_set_by_id"], name: "index_group_assignments_on_period_end_set_by_id"
405
406
    t.index ["period_start"], name: "index_group_assignments_on_period_start"
    t.index ["submitted_at"], name: "index_group_assignments_on_submitted_at"
407
    t.index ["submitted_by_id"], name: "index_group_assignments_on_submitted_by_id"
408
    t.index ["termination_submitted_at"], name: "index_group_assignments_on_termination_submitted_at"
409
    t.index ["termination_submitted_by_id"], name: "index_group_assignments_on_termination_submitted_by_id"
410
    t.index ["termination_verified_at"], name: "index_group_assignments_on_termination_verified_at"
411
    t.index ["termination_verified_by_id"], name: "index_group_assignments_on_termination_verified_by_id"
412
413
414
    t.index ["volunteer_id"], name: "index_group_assignments_on_volunteer_id"
  end

415
416
417
  create_table "group_offer_categories", force: :cascade do |t|
    t.string "category_name"
    t.string "category_state", default: "active"
418
    t.datetime "deleted_at"
419
420
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
421
    t.text "description"
422
    t.index ["deleted_at"], name: "index_group_offer_categories_on_deleted_at"
423
424
  end

425
426
427
428
429
430
431
432
  create_table "group_offer_categories_volunteers", id: false, force: :cascade do |t|
    t.bigint "group_offer_category_id", null: false
    t.bigint "volunteer_id", null: false
    t.datetime "deleted_at"
    t.index ["deleted_at"], name: "index_group_offer_categories_volunteers_on_deleted_at"
    t.index ["group_offer_category_id", "volunteer_id"], name: "index_group_offer_on_volunteer"
  end

433
434
  create_table "group_offers", force: :cascade do |t|
    t.string "title"
435
    t.string "offer_type", default: "internal_offer", null: false
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
    t.string "offer_state"
    t.integer "necessary_volunteers"
    t.text "description"
    t.boolean "women", default: false
    t.boolean "men", default: false
    t.boolean "children", default: false
    t.boolean "teenagers", default: false
    t.boolean "unaccompanied", default: false
    t.boolean "all", default: false
    t.boolean "long_term", default: false
    t.boolean "regular", default: false
    t.boolean "short_term", default: false
    t.boolean "workday", default: false
    t.boolean "weekend", default: false
    t.boolean "flexible", default: false
    t.boolean "morning", default: false
    t.boolean "afternoon", default: false
    t.boolean "evening", default: false
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
454
    t.text "schedule_details"
455
456
    t.datetime "deleted_at"
    t.string "organization"
457
    t.string "location"
458
459
    t.bigint "department_id"
    t.datetime "created_at", null: false
460
    t.datetime "updated_at", null: false
461
    t.bigint "group_offer_category_id", null: false
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
462
    t.boolean "active", default: true
463
    t.bigint "creator_id"
464
    t.string "search_volunteer"
465
466
467
    t.bigint "period_end_set_by_id"
    t.date "period_start"
    t.date "period_end"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
468
    t.text "comments"
469
    t.index ["creator_id"], name: "index_group_offers_on_creator_id"
470
471
    t.index ["deleted_at"], name: "index_group_offers_on_deleted_at"
    t.index ["department_id"], name: "index_group_offers_on_department_id"
472
    t.index ["group_offer_category_id"], name: "index_group_offers_on_group_offer_category_id"
473
    t.index ["period_end"], name: "index_group_offers_on_period_end"
474
    t.index ["period_end_set_by_id"], name: "index_group_offers_on_period_end_set_by_id"
475
476
    t.index ["period_start"], name: "index_group_offers_on_period_start"
    t.index ["search_volunteer"], name: "index_group_offers_on_search_volunteer"
477
478
  end

Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
479
480
  create_table "hours", force: :cascade do |t|
    t.date "meeting_date"
481
    t.float "hours", default: 0.0
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
482
    t.string "activity"
483
    t.text "comments"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
484
    t.bigint "volunteer_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
485
    t.datetime "deleted_at"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
486
487
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
488
    t.bigint "billing_expense_id"
489
490
    t.string "hourable_type"
    t.bigint "hourable_id"
491
    t.bigint "reviewer_id"
492
    t.bigint "semester_process_volunteer_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
493
    t.index ["billing_expense_id"], name: "index_hours_on_billing_expense_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
494
    t.index ["deleted_at"], name: "index_hours_on_deleted_at"
495
    t.index ["hourable_type", "hourable_id"], name: "index_hours_on_hourable_type_and_hourable_id"
496
    t.index ["meeting_date"], name: "index_hours_on_meeting_date"
497
    t.index ["reviewer_id"], name: "index_hours_on_reviewer_id"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
498
499
500
    t.index ["volunteer_id"], name: "index_hours_on_volunteer_id"
  end

501
502
503
504
505
506
507
508
  create_table "imports", force: :cascade do |t|
    t.bigint "access_id"
    t.jsonb "store"
    t.string "importable_type"
    t.bigint "importable_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
509
    t.string "base_origin_entity"
510
511
512
513
514
    t.index ["access_id"], name: "index_imports_on_access_id"
    t.index ["deleted_at"], name: "index_imports_on_deleted_at"
    t.index ["importable_type", "importable_id"], name: "index_imports_on_importable_type_and_importable_id"
  end

Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
515
516
517
518
519
520
521
522
  create_table "journals", force: :cascade do |t|
    t.bigint "user_id"
    t.text "body"
    t.string "journalable_type"
    t.bigint "journalable_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
523
    t.string "category"
524
    t.bigint "assignment_id"
Markus Koller's avatar
Markus Koller committed
525
    t.string "title"
526
    t.index ["assignment_id"], name: "index_journals_on_assignment_id"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
527
528
529
530
531
    t.index ["deleted_at"], name: "index_journals_on_deleted_at"
    t.index ["journalable_type", "journalable_id"], name: "index_journals_on_journalable_type_and_journalable_id"
    t.index ["user_id"], name: "index_journals_on_user_id"
  end

532
  create_table "language_skills", force: :cascade do |t|
533
    t.bigint "languageable_id"
534
535
536
537
    t.string "language"
    t.string "level"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Tugce Nur Tas's avatar
Tugce Nur Tas committed
538
    t.datetime "deleted_at"
539
    t.string "languageable_type"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
540
    t.index ["deleted_at"], name: "index_language_skills_on_deleted_at"
541
    t.index ["languageable_type", "languageable_id"], name: "index_language_skills_on_languageable_type_and_languageable_id"
542
543
  end

544
  create_table "performance_reports", force: :cascade do |t|
545
546
    t.date "period_start"
    t.date "period_end"
547
    t.integer "year"
548
549
    t.bigint "user_id"
    t.jsonb "report_content"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
550
551
    t.string "title"
    t.text "comment"
552
    t.datetime "deleted_at"
553
554
555
556
557
558
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["deleted_at"], name: "index_performance_reports_on_deleted_at"
    t.index ["user_id"], name: "index_performance_reports_on_user_id"
  end

559
560
561
562
563
  create_table "profiles", force: :cascade do |t|
    t.bigint "user_id"
    t.string "profession"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
564
565
566
567
    t.string "avatar_file_name"
    t.string "avatar_content_type"
    t.integer "avatar_file_size"
    t.datetime "avatar_updated_at"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
568
    t.datetime "deleted_at"
569
570
571
572
573
574
575
    t.boolean "flexible", default: false
    t.boolean "morning", default: false
    t.boolean "afternoon", default: false
    t.boolean "evening", default: false
    t.boolean "workday", default: false
    t.boolean "weekend", default: false
    t.text "detailed_description"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
576
    t.index ["deleted_at"], name: "index_profiles_on_deleted_at"
577
578
579
    t.index ["user_id"], name: "index_profiles_on_user_id"
  end

580
  create_table "relatives", force: :cascade do |t|
581
    t.bigint "relativeable_id"
582
583
    t.string "first_name"
    t.string "last_name"
584
    t.date "birth_year"
585
586
587
    t.string "relation"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
Tugce Nur Tas's avatar
Tugce Nur Tas committed
588
    t.datetime "deleted_at"
589
    t.string "relativeable_type"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
590
    t.index ["deleted_at"], name: "index_relatives_on_deleted_at"
591
    t.index ["relativeable_type", "relativeable_id"], name: "index_relatives_on_relativeable_type_and_relativeable_id"
592
593
  end

594
595
596
597
598
599
  create_table "reminder_mailing_volunteers", force: :cascade do |t|
    t.bigint "volunteer_id"
    t.bigint "reminder_mailing_id"
    t.string "reminder_mailable_type"
    t.bigint "reminder_mailable_id"
    t.boolean "confirmed_form", default: false
600
    t.boolean "email_sent", default: false
601
    t.datetime "deleted_at"
602
603
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
604
    t.boolean "picked", default: false
605
606
    t.datetime "process_submitted_at"
    t.bigint "process_submitted_by_id"
607
    t.index ["deleted_at"], name: "index_reminder_mailing_volunteers_on_deleted_at"
608
    t.index ["process_submitted_by_id"], name: "index_reminder_mailing_volunteers_on_process_submitted_by_id"
609
610
611
612
613
614
615
    t.index ["reminder_mailable_type", "reminder_mailable_id"], name: "reminder_mailable_index"
    t.index ["reminder_mailing_id"], name: "index_reminder_mailing_volunteers_on_reminder_mailing_id"
    t.index ["volunteer_id"], name: "index_reminder_mailing_volunteers_on_volunteer_id"
  end

  create_table "reminder_mailings", force: :cascade do |t|
    t.bigint "creator_id"
616
    t.text "body"
617
618
    t.string "subject"
    t.integer "kind", default: 0
619
    t.boolean "sending_triggered", default: false
620
    t.datetime "deleted_at"
621
622
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
623
    t.boolean "obsolete", default: false
624
    t.index ["creator_id"], name: "index_reminder_mailings_on_creator_id"
625
    t.index ["deleted_at"], name: "index_reminder_mailings_on_deleted_at"
626
627
  end

628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
  create_table "semester_feedbacks", force: :cascade do |t|
    t.bigint "author_id"
    t.bigint "semester_process_volunteer_id"
    t.integer "semester_feedbackable_id"
    t.string "semester_feedbackable_type"
    t.text "goals"
    t.text "achievements"
    t.text "future"
    t.text "comments"
    t.boolean "conversation", default: false
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["author_id"], name: "index_semester_feedbacks_on_author_id"
    t.index ["deleted_at"], name: "index_semester_feedbacks_on_deleted_at"
  end

645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
  create_table "semester_process_mails", force: :cascade do |t|
    t.bigint "semester_process_volunteer_id"
    t.bigint "sent_by_id"
    t.datetime "sent_at"
    t.string "subject"
    t.text "body"
    t.integer "type"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["deleted_at"], name: "index_semester_process_mails_on_deleted_at"
    t.index ["semester_process_volunteer_id"], name: "index_semester_process_mails_on_semester_process_volunteer_id"
    t.index ["sent_by_id"], name: "index_semester_process_mails_on_sent_by_id"
  end

660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
  create_table "semester_process_volunteers", force: :cascade do |t|
    t.bigint "volunteer_id"
    t.bigint "semester_process_id"
    t.datetime "commit_visited_at"
    t.datetime "commited_at"
    t.bigint "commited_by_id"
    t.bigint "responsible_id"
    t.datetime "responsibility_taken_at"
    t.bigint "reviewed_by_id"
    t.datetime "reviewed_at"
    t.jsonb "notes"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["commited_by_id"], name: "index_semester_process_volunteers_on_commited_by_id"
    t.index ["deleted_at"], name: "index_semester_process_volunteers_on_deleted_at"
    t.index ["responsible_id"], name: "index_semester_process_volunteers_on_responsible_id"
    t.index ["reviewed_by_id"], name: "index_semester_process_volunteers_on_reviewed_by_id"
    t.index ["semester_process_id"], name: "index_semester_process_volunteers_on_semester_process_id"
    t.index ["volunteer_id"], name: "index_semester_process_volunteers_on_volunteer_id"
  end

682
683
684
685
686
  create_table "semester_processes", force: :cascade do |t|
    t.bigint "creator_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
687
688
689
690
691
692
693
694
695
    t.daterange "semester"
    t.string "mail_subject_template"
    t.text "mail_body_template"
    t.datetime "mail_posted_at"
    t.bigint "mail_posted_by_id"
    t.string "reminder_mail_subject_template"
    t.text "reminder_mail_body_template"
    t.datetime "reminder_mail_posted_at"
    t.bigint "reminder_mail_posted_by_id"
696
697
    t.index ["creator_id"], name: "index_semester_processes_on_creator_id"
    t.index ["deleted_at"], name: "index_semester_processes_on_deleted_at"
698
699
    t.index ["mail_posted_by_id"], name: "index_semester_processes_on_mail_posted_by_id"
    t.index ["reminder_mail_posted_by_id"], name: "index_semester_processes_on_reminder_mail_posted_by_id"
700
701
  end

702
703
  create_table "trial_feedbacks", force: :cascade do |t|
    t.text "body"
704
705
    t.integer "trial_feedbackable_id"
    t.string "trial_feedbackable_type"
706
707
708
709
710
711
712
713
714
    t.bigint "volunteer_id"
    t.bigint "author_id"
    t.bigint "reviewer_id"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["author_id"], name: "index_trial_feedbacks_on_author_id"
    t.index ["deleted_at"], name: "index_trial_feedbacks_on_deleted_at"
    t.index ["reviewer_id"], name: "index_trial_feedbacks_on_reviewer_id"
715
    t.index ["trial_feedbackable_id", "trial_feedbackable_type"], name: "trial_feedback_polymorphic_index"
716
717
718
    t.index ["volunteer_id"], name: "index_trial_feedbacks_on_volunteer_id"
  end

Tugce Nur Tas's avatar
Tugce Nur Tas committed
719
720
721
722
723
724
725
726
727
728
729
730
731
732
  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.integer "sign_in_count", default: 0, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.inet "current_sign_in_ip"
    t.inet "last_sign_in_ip"
    t.string "role", default: "", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
733
734
735
736
737
738
    t.string "invitation_token"
    t.datetime "invitation_created_at"
    t.datetime "invitation_sent_at"
    t.datetime "invitation_accepted_at"
    t.integer "invitation_limit"
    t.integer "invited_by_id"
739
    t.datetime "deleted_at"
740
    t.boolean "active"
741
    t.index ["deleted_at"], name: "index_users_on_deleted_at"
742
    t.index ["email", "active"], name: "index_users_on_email_and_active", unique: true
743
    t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true
Tugce Nur Tas's avatar
Tugce Nur Tas committed
744
745
746
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

747
  create_table "volunteers", force: :cascade do |t|
748
    t.date "birth_year"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
749
    t.string "salutation"
750
    t.string "nationality"
751
    t.string "additional_nationality"
752
753
754
    t.string "profession"
    t.text "education"
    t.text "motivation"
755
    t.boolean "experience", default: false
756
757
758
    t.text "expectations"
    t.text "strengths"
    t.text "interests"
759
    t.string "state", default: "registered"
760
761
762
763
    t.boolean "man", default: false
    t.boolean "woman", default: false
    t.boolean "family", default: false
    t.boolean "kid", default: false
764
765
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
766
    t.datetime "deleted_at"
767
768
769
770
    t.string "avatar_file_name"
    t.string "avatar_content_type"
    t.integer "avatar_file_size"
    t.datetime "avatar_updated_at"
771
    t.bigint "user_id"
772
773
    t.string "rejection_type"
    t.text "rejection_text"
774
    t.integer "working_percent"
775
    t.text "volunteer_experience_desc"
776
    t.bigint "registrar_id"
777
778
779
780
781
    t.boolean "trial_period", default: false
    t.boolean "intro_course", default: false
    t.boolean "doc_sent", default: false
    t.boolean "bank_account", default: false
    t.boolean "evaluation", default: false
782
    t.boolean "unaccompanied", default: false
783
784
    t.text "other_offer_desc"
    t.text "own_kids"
785
786
787
788
789
790
791
    t.boolean "flexible", default: false
    t.boolean "morning", default: false
    t.boolean "afternoon", default: false
    t.boolean "evening", default: false
    t.boolean "workday", default: false
    t.boolean "weekend", default: false
    t.text "detailed_description"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
792
793
794
    t.string "bank"
    t.string "iban"
    t.boolean "waive", default: false
795
    t.boolean "external", default: false
796
797
798
799
800
801
    t.integer "acceptance", default: 0
    t.datetime "accepted_at"
    t.datetime "rejected_at"
    t.datetime "resigned_at"
    t.datetime "undecided_at"
    t.boolean "take_more_assignments", default: false
802
    t.boolean "active", default: false
803
    t.date "activeness_might_end"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
804
    t.datetime "invited_at"
805
806
    t.text "comments"
    t.text "additional_comments"
Emily Wangler's avatar
Emily Wangler committed
807
    t.boolean "teenager"
808
    t.bigint "department_id"
809
    t.datetime "last_billing_expense_on"
810
811
812
813
814
    t.index ["acceptance"], name: "index_volunteers_on_acceptance"
    t.index ["accepted_at"], name: "index_volunteers_on_accepted_at"
    t.index ["active"], name: "index_volunteers_on_active"
    t.index ["activeness_might_end"], name: "index_volunteers_on_activeness_might_end"
    t.index ["birth_year"], name: "index_volunteers_on_birth_year"
815
    t.index ["deleted_at"], name: "index_volunteers_on_deleted_at"
816
    t.index ["department_id"], name: "index_volunteers_on_department_id"
817
818
819
820
821
822
823
    t.index ["external"], name: "index_volunteers_on_external"
    t.index ["invited_at"], name: "index_volunteers_on_invited_at"
    t.index ["nationality"], name: "index_volunteers_on_nationality"
    t.index ["rejected_at"], name: "index_volunteers_on_rejected_at"
    t.index ["resigned_at"], name: "index_volunteers_on_resigned_at"
    t.index ["salutation"], name: "index_volunteers_on_salutation"
    t.index ["undecided_at"], name: "index_volunteers_on_undecided_at"
824
    t.index ["user_id"], name: "index_volunteers_on_user_id"
825
826
  end

827
828
829
  add_foreign_key "assignment_logs", "assignments"
  add_foreign_key "assignment_logs", "clients"
  add_foreign_key "assignment_logs", "volunteers"
Andi Staub's avatar
Andi Staub committed
830
  add_foreign_key "assignments", "clients"
831
  add_foreign_key "assignments", "users", column: "creator_id"
Andi Staub's avatar
Andi Staub committed
832
  add_foreign_key "assignments", "volunteers"
833
834
  add_foreign_key "certificates", "users"
  add_foreign_key "certificates", "volunteers"
835
  add_foreign_key "client_notifications", "users"
836
  add_foreign_key "clients", "users"
837
  add_foreign_key "events", "departments"
838
  add_foreign_key "feedbacks", "users", column: "author_id"
839
  add_foreign_key "group_offers", "departments"
840
  add_foreign_key "group_offers", "group_offer_categories"
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
841
  add_foreign_key "hours", "billing_expenses"
842
  add_foreign_key "journals", "assignments"
Kaspar Vollenweider's avatar
Kaspar Vollenweider committed
843
  add_foreign_key "journals", "users"
844
  add_foreign_key "performance_reports", "users"
845
  add_foreign_key "profiles", "users"
846
  add_foreign_key "semester_process_mails", "semester_process_volunteers"
847
848
  add_foreign_key "semester_process_volunteers", "semester_processes"
  add_foreign_key "semester_process_volunteers", "volunteers"
849
  add_foreign_key "trial_feedbacks", "users", column: "author_id"
850
  add_foreign_key "volunteers", "departments"
851
  add_foreign_key "volunteers", "users"
Tugce Nur Tas's avatar
Tugce Nur Tas committed
852
end