|
11 | 11 | # |
12 | 12 | # It's strongly recommended that you check this file into your version control system. |
13 | 13 |
|
14 | | -ActiveRecord::Schema.define(version: 20170428083711) do |
| 14 | +ActiveRecord::Schema.define(version: 20170702012742) do |
15 | 15 |
|
16 | 16 | # These are extensions that must be enabled in order to support this database |
17 | 17 | enable_extension "plpgsql" |
|
25 | 25 | t.datetime "updated_at" |
26 | 26 | end |
27 | 27 |
|
| 28 | + add_index "annotations", ["question_id"], name: "index_annotations_on_question_id", using: :btree |
| 29 | + |
28 | 30 | create_table "answers", force: :cascade do |t| |
29 | 31 | t.text "text" |
30 | 32 | t.integer "plan_id" |
|
40 | 42 | t.integer "question_option_id", null: false |
41 | 43 | end |
42 | 44 |
|
43 | | - add_index "answers_question_options", ["answer_id", "question_option_id"], name: "answer_question_option_index", using: :btree |
44 | | - add_index "answers_question_options", ["question_option_id", "answer_id"], name: "question_option_answer_index", using: :btree |
| 45 | + add_index "answers_question_options", ["answer_id"], name: "index_answers_question_options_on_answer_id", using: :btree |
45 | 46 |
|
46 | 47 | create_table "exported_plans", force: :cascade do |t| |
47 | 48 | t.integer "plan_id" |
|
93 | 94 | t.boolean "published" |
94 | 95 | end |
95 | 96 |
|
| 97 | + add_index "guidance_groups", ["org_id"], name: "index_guidance_groups_on_org_id", using: :btree |
| 98 | + |
96 | 99 | create_table "guidances", force: :cascade do |t| |
97 | 100 | t.text "text" |
98 | 101 | t.integer "guidance_group_id" |
|
102 | 105 | t.boolean "published" |
103 | 106 | end |
104 | 107 |
|
| 108 | + add_index "guidances", ["guidance_group_id"], name: "index_guidances_on_guidance_group_id", using: :btree |
| 109 | + |
105 | 110 | create_table "identifier_schemes", force: :cascade do |t| |
106 | 111 | t.string "name" |
107 | 112 | t.string "description" |
|
129 | 134 | t.datetime "updated_at" |
130 | 135 | end |
131 | 136 |
|
| 137 | + add_index "notes", ["answer_id"], name: "index_notes_on_answer_id", using: :btree |
| 138 | + |
132 | 139 | create_table "org_token_permissions", force: :cascade do |t| |
133 | 140 | t.integer "org_id" |
134 | 141 | t.integer "token_permission_type_id" |
135 | 142 | t.datetime "created_at" |
136 | 143 | t.datetime "updated_at" |
137 | 144 | end |
138 | 145 |
|
| 146 | + add_index "org_token_permissions", ["org_id"], name: "index_org_token_permissions_on_org_id", using: :btree |
| 147 | + |
139 | 148 | create_table "orgs", force: :cascade do |t| |
140 | 149 | t.string "name" |
141 | 150 | t.string "abbreviation" |
|
219 | 228 | t.datetime "updated_at" |
220 | 229 | end |
221 | 230 |
|
| 231 | + add_index "question_options", ["question_id"], name: "index_question_options_on_question_id", using: :btree |
| 232 | + |
222 | 233 | create_table "questions", force: :cascade do |t| |
223 | 234 | t.text "text" |
224 | 235 | t.text "default_value" |
|
238 | 249 | t.integer "theme_id", null: false |
239 | 250 | end |
240 | 251 |
|
241 | | - add_index "questions_themes", ["question_id", "theme_id"], name: "question_theme_index", using: :btree |
242 | | - add_index "questions_themes", ["theme_id", "question_id"], name: "theme_question_index", using: :btree |
| 252 | + add_index "questions_themes", ["question_id"], name: "index_questions_themes_on_question_id", using: :btree |
243 | 253 |
|
244 | 254 | create_table "regions", force: :cascade do |t| |
245 | 255 | t.string "abbreviation" |
|
256 | 266 | t.integer "access", default: 0, null: false |
257 | 267 | end |
258 | 268 |
|
| 269 | + add_index "roles", ["plan_id"], name: "index_roles_on_plan_id", using: :btree |
| 270 | + add_index "roles", ["user_id"], name: "index_roles_on_user_id", using: :btree |
| 271 | + |
259 | 272 | create_table "sections", force: :cascade do |t| |
260 | 273 | t.string "title" |
261 | 274 | t.text "description" |
|
319 | 332 | t.integer "guidance_id" |
320 | 333 | end |
321 | 334 |
|
| 335 | + add_index "themes_in_guidance", ["guidance_id"], name: "index_themes_in_guidance_on_guidance_id", using: :btree |
| 336 | + add_index "themes_in_guidance", ["theme_id"], name: "index_themes_in_guidance_on_theme_id", using: :btree |
| 337 | + |
322 | 338 | create_table "token_permission_types", force: :cascade do |t| |
323 | 339 | t.string "token_type" |
324 | 340 | t.text "text_description" |
|
334 | 350 | t.integer "identifier_scheme_id" |
335 | 351 | end |
336 | 352 |
|
| 353 | + add_index "user_identifiers", ["user_id"], name: "index_user_identifiers_on_user_id", using: :btree |
| 354 | + |
337 | 355 | create_table "users", force: :cascade do |t| |
338 | 356 | t.string "firstname" |
339 | 357 | t.string "surname" |
340 | 358 | t.string "email", default: "", null: false |
341 | 359 | t.string "orcid_id" |
342 | 360 | t.string "shibboleth_id" |
343 | | - t.datetime "created_at" |
344 | | - t.datetime "updated_at" |
| 361 | + t.datetime "created_at", null: false |
| 362 | + t.datetime "updated_at", null: false |
345 | 363 | t.string "encrypted_password", default: "" |
346 | 364 | t.string "reset_password_token" |
347 | 365 | t.datetime "reset_password_sent_at" |
|
367 | 385 | t.integer "language_id" |
368 | 386 | end |
369 | 387 |
|
370 | | - add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree |
371 | 388 | add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree |
372 | | - add_index "users", ["invitation_token"], name: "index_users_on_invitation_token", unique: true, using: :btree |
373 | | - add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree |
| 389 | + add_index "users", ["org_id"], name: "index_users_on_org_id", using: :btree |
374 | 390 |
|
375 | 391 | create_table "users_perms", id: false, force: :cascade do |t| |
376 | 392 | t.integer "user_id" |
377 | 393 | t.integer "perm_id" |
378 | 394 | end |
379 | 395 |
|
380 | | - add_index "users_perms", ["user_id", "perm_id"], name: "index_users_perms_on_user_id_and_perm_id", using: :btree |
| 396 | + add_index "users_perms", ["user_id"], name: "index_users_perms_on_user_id", using: :btree |
381 | 397 |
|
382 | 398 | add_foreign_key "annotations", "orgs" |
383 | 399 | add_foreign_key "annotations", "questions" |
|
0 commit comments