|
14 | 14 | # These are extensions that must be enabled in order to support this database |
15 | 15 | enable_extension "plpgsql" |
16 | 16 |
|
17 | | - create_table "admin_users", id: :serial, force: :cascade do |t| |
18 | | - t.string "email", default: "", null: false |
19 | | - t.string "encrypted_password", default: "", null: false |
20 | | - t.string "reset_password_token" |
21 | | - t.datetime "reset_password_sent_at", precision: nil |
22 | | - t.datetime "remember_created_at", precision: nil |
23 | | - t.integer "sign_in_count", default: 0 |
24 | | - t.datetime "current_sign_in_at", precision: nil |
25 | | - t.datetime "last_sign_in_at", precision: nil |
26 | | - t.string "current_sign_in_ip" |
27 | | - t.string "last_sign_in_ip" |
28 | | - t.datetime "created_at", precision: nil |
29 | | - t.datetime "updated_at", precision: nil |
30 | | - end |
31 | | - |
32 | 17 | create_table "annotations", id: :serial, force: :cascade do |t| |
33 | 18 | t.integer "question_id" |
34 | 19 | t.integer "org_id" |
|
57 | 42 | t.index ["user_id"], name: "fk_rails_584be190c2" |
58 | 43 | end |
59 | 44 |
|
60 | | - create_table "answers_options", id: false, force: :cascade do |t| |
61 | | - t.integer "answer_id", null: false |
62 | | - t.integer "option_id", null: false |
63 | | - t.index ["answer_id", "option_id"], name: "index_answers_options_on_answer_id_and_option_id" |
64 | | - end |
65 | | - |
66 | 45 | create_table "answers_question_options", id: false, force: :cascade do |t| |
67 | 46 | t.integer "answer_id", null: false |
68 | 47 | t.integer "question_option_id", null: false |
|
90 | 69 | t.index ["name"], name: "index_oauth_applications_on_name" |
91 | 70 | end |
92 | 71 |
|
93 | | - create_table "api_servers", force: :cascade do |t| |
94 | | - t.string "title" |
95 | | - t.string "description" |
96 | | - t.datetime "created_at", null: false |
97 | | - t.datetime "updated_at", null: false |
98 | | - end |
99 | | - |
100 | 72 | create_table "conditions", id: :serial, force: :cascade do |t| |
101 | 73 | t.integer "question_id" |
102 | 74 | t.text "option_list" |
|
134 | 106 | t.index ["org_id"], name: "index_departments_on_org_id" |
135 | 107 | end |
136 | 108 |
|
137 | | - create_table "dmptemplates", id: :serial, force: :cascade do |t| |
138 | | - t.string "title" |
139 | | - t.text "description" |
140 | | - t.boolean "published" |
141 | | - t.integer "user_id" |
142 | | - t.integer "organisation_id" |
143 | | - t.datetime "created_at", precision: nil |
144 | | - t.datetime "updated_at", precision: nil |
145 | | - t.string "locale" |
146 | | - t.boolean "is_default" |
147 | | - end |
148 | | - |
149 | 109 | create_table "exported_plans", id: :serial, force: :cascade do |t| |
150 | 110 | t.integer "plan_id" |
151 | 111 | t.integer "user_id" |
|
170 | 130 | t.index ["user_id"], name: "index_external_api_access_tokens_on_user_id" |
171 | 131 | end |
172 | 132 |
|
173 | | - create_table "file_types", id: :serial, force: :cascade do |t| |
174 | | - t.string "name" |
175 | | - t.string "icon_name" |
176 | | - t.integer "icon_size" |
177 | | - t.string "icon_location" |
178 | | - t.datetime "created_at", precision: nil |
179 | | - t.datetime "updated_at", precision: nil |
180 | | - end |
181 | | - |
182 | | - create_table "file_uploads", id: :serial, force: :cascade do |t| |
183 | | - t.string "name" |
184 | | - t.string "title" |
185 | | - t.text "description" |
186 | | - t.integer "size" |
187 | | - t.boolean "published" |
188 | | - t.string "location" |
189 | | - t.integer "file_type_id" |
190 | | - t.datetime "created_at", precision: nil |
191 | | - t.datetime "updated_at", precision: nil |
192 | | - end |
193 | | - |
194 | | - create_table "friendly_id_slugs", id: :serial, force: :cascade do |t| |
195 | | - t.string "slug", null: false |
196 | | - t.integer "sluggable_id", null: false |
197 | | - t.string "sluggable_type", limit: 40 |
198 | | - t.datetime "created_at", precision: nil |
199 | | - t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true |
200 | | - t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" |
201 | | - t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" |
202 | | - end |
203 | | - |
204 | 133 | create_table "guidance_groups", id: :serial, force: :cascade do |t| |
205 | 134 | t.string "name" |
206 | 135 | t.integer "org_id" |
|
211 | 140 | t.index ["org_id"], name: "index_guidance_groups_on_org_id" |
212 | 141 | end |
213 | 142 |
|
214 | | - create_table "guidance_in_group", id: false, force: :cascade do |t| |
215 | | - t.integer "guidance_id", null: false |
216 | | - t.integer "guidance_group_id", null: false |
217 | | - t.index ["guidance_id", "guidance_group_id"], name: "index_guidance_in_group_on_guidance_id_and_guidance_group_id" |
218 | | - end |
219 | | - |
220 | 143 | create_table "guidances", id: :serial, force: :cascade do |t| |
221 | 144 | t.text "text" |
222 | 145 | t.integer "guidance_group_id" |
|
323 | 246 | t.boolean "enabled", default: true |
324 | 247 | end |
325 | 248 |
|
326 | | - create_table "oauth_access_grants", force: :cascade do |t| |
327 | | - t.bigint "resource_owner_id", null: false |
328 | | - t.bigint "application_id", null: false |
329 | | - t.string "token", null: false |
330 | | - t.integer "expires_in", null: false |
331 | | - t.text "redirect_uri", null: false |
332 | | - t.string "scopes", default: "", null: false |
333 | | - t.datetime "created_at", precision: nil, null: false |
334 | | - t.datetime "revoked_at", precision: nil |
335 | | - t.index ["application_id"], name: "index_oauth_access_grants_on_application_id" |
336 | | - t.index ["resource_owner_id"], name: "index_oauth_access_grants_on_resource_owner_id" |
337 | | - t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true |
338 | | - end |
339 | | - |
340 | | - create_table "oauth_access_tokens", force: :cascade do |t| |
341 | | - t.bigint "resource_owner_id" |
342 | | - t.bigint "application_id", null: false |
343 | | - t.string "token", null: false |
344 | | - t.string "refresh_token" |
345 | | - t.integer "expires_in" |
346 | | - t.string "scopes" |
347 | | - t.datetime "created_at", precision: nil, null: false |
348 | | - t.datetime "revoked_at", precision: nil |
349 | | - t.string "previous_refresh_token", default: "", null: false |
350 | | - t.index ["application_id"], name: "index_oauth_access_tokens_on_application_id" |
351 | | - t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true |
352 | | - t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id" |
353 | | - t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true |
354 | | - end |
355 | | - |
356 | | - create_table "oauth_applications", force: :cascade do |t| |
357 | | - t.string "name", null: false |
358 | | - t.string "uid", null: false |
359 | | - t.string "secret", null: false |
360 | | - t.text "redirect_uri", null: false |
361 | | - t.string "scopes", default: "", null: false |
362 | | - t.boolean "confidential", default: true, null: false |
363 | | - t.datetime "created_at", null: false |
364 | | - t.datetime "updated_at", null: false |
365 | | - t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true |
366 | | - end |
367 | | - |
368 | | - create_table "option_warnings", id: :serial, force: :cascade do |t| |
369 | | - t.integer "organisation_id" |
370 | | - t.integer "option_id" |
371 | | - t.text "text" |
372 | | - t.datetime "created_at", precision: nil |
373 | | - t.datetime "updated_at", precision: nil |
374 | | - end |
375 | | - |
376 | | - create_table "options", id: :serial, force: :cascade do |t| |
377 | | - t.integer "question_id" |
378 | | - t.string "text" |
379 | | - t.integer "number" |
380 | | - t.boolean "is_default" |
381 | | - t.datetime "created_at", precision: nil |
382 | | - t.datetime "updated_at", precision: nil |
383 | | - end |
384 | | - |
385 | 249 | create_table "org_domains", force: :cascade do |t| |
386 | 250 | t.bigint "org_id", null: false |
387 | 251 | t.text "domain", null: false |
|
407 | 271 | t.index ["token_permission_type_id"], name: "fk_rails_2aa265f538" |
408 | 272 | end |
409 | 273 |
|
410 | | - create_table "organisation_types", id: :serial, force: :cascade do |t| |
411 | | - t.string "name" |
412 | | - t.text "description" |
413 | | - t.datetime "created_at", precision: nil |
414 | | - t.datetime "updated_at", precision: nil |
415 | | - end |
416 | | - |
417 | | - create_table "organisations", id: :serial, force: :cascade do |t| |
418 | | - t.string "name" |
419 | | - t.string "abbreviation" |
420 | | - t.text "description" |
421 | | - t.string "target_url" |
422 | | - t.integer "logo_file_id" |
423 | | - t.integer "banner_file_id" |
424 | | - t.integer "organisation_type_id" |
425 | | - t.string "domain" |
426 | | - t.integer "wayfless_entity" |
427 | | - t.integer "stylesheet_file_id" |
428 | | - t.datetime "created_at", precision: nil |
429 | | - t.datetime "updated_at", precision: nil |
430 | | - t.integer "parent_id" |
431 | | - t.boolean "is_other" |
432 | | - end |
433 | | - |
434 | 274 | create_table "orgs", id: :serial, force: :cascade do |t| |
435 | 275 | t.string "name" |
436 | 276 | t.string "abbreviation" |
|
456 | 296 | t.index ["region_id"], name: "fk_rails_5a6adf6bab" |
457 | 297 | end |
458 | 298 |
|
459 | | - create_table "pages", id: :serial, force: :cascade do |t| |
460 | | - t.string "title" |
461 | | - t.text "body_text" |
462 | | - t.string "slug" |
463 | | - t.integer "menu" |
464 | | - t.integer "menu_position" |
465 | | - t.string "target_url" |
466 | | - t.string "location" |
467 | | - t.boolean "public" |
468 | | - t.integer "organisation_id" |
469 | | - t.datetime "created_at", precision: nil |
470 | | - t.datetime "updated_at", precision: nil |
471 | | - end |
472 | | - |
473 | 299 | create_table "perms", id: :serial, force: :cascade do |t| |
474 | 300 | t.string "name" |
475 | 301 | t.datetime "created_at", precision: nil, null: false |
|
489 | 315 | t.index ["versionable_id"], name: "index_phases_on_versionable_id" |
490 | 316 | end |
491 | 317 |
|
492 | | - create_table "plan_sections", id: :serial, force: :cascade do |t| |
493 | | - t.integer "user_id" |
494 | | - t.integer "section_id" |
495 | | - t.integer "plan_id" |
496 | | - t.datetime "created_at", precision: nil |
497 | | - t.datetime "updated_at", precision: nil |
498 | | - t.datetime "release_time", precision: nil |
499 | | - end |
500 | | - |
501 | 318 | create_table "plans", id: :serial, force: :cascade do |t| |
502 | 319 | t.string "title" |
503 | 320 | t.integer "template_id" |
|
540 | 357 | t.integer "user_id" |
541 | 358 | end |
542 | 359 |
|
543 | | - create_table "project_groups", id: :serial, force: :cascade do |t| |
544 | | - t.boolean "project_creator" |
545 | | - t.boolean "project_editor" |
546 | | - t.integer "user_id" |
547 | | - t.integer "project_id" |
548 | | - t.datetime "created_at", precision: nil |
549 | | - t.datetime "updated_at", precision: nil |
550 | | - t.boolean "project_administrator" |
551 | | - end |
552 | | - |
553 | | - create_table "project_guidance", id: false, force: :cascade do |t| |
554 | | - t.integer "project_id", null: false |
555 | | - t.integer "guidance_group_id", null: false |
556 | | - t.index ["project_id", "guidance_group_id"], name: "index_project_guidance_on_project_id_and_guidance_group_id" |
557 | | - end |
558 | | - |
559 | | - create_table "projects", id: :serial, force: :cascade do |t| |
560 | | - t.string "title" |
561 | | - t.text "note" |
562 | | - t.boolean "locked" |
563 | | - t.integer "dmptemplate_id" |
564 | | - t.datetime "created_at", precision: nil |
565 | | - t.datetime "updated_at", precision: nil |
566 | | - t.string "slug" |
567 | | - t.integer "organisation_id" |
568 | | - t.string "grant_number" |
569 | | - t.string "identifier" |
570 | | - t.string "description" |
571 | | - t.string "principal_investigator" |
572 | | - t.string "principal_investigator_identifier" |
573 | | - t.string "data_contact" |
574 | | - t.index ["slug"], name: "index_projects_on_slug", unique: true |
575 | | - end |
576 | | - |
577 | 360 | create_table "question_format_labels", id: false, force: :cascade do |t| |
578 | 361 | t.integer "id" |
579 | 362 | t.string "description" |
|
592 | 375 | t.integer "formattype", default: 0 |
593 | 376 | end |
594 | 377 |
|
595 | | - create_table "question_identifiers", force: :cascade do |t| |
596 | | - t.integer "question_id" |
597 | | - t.string "value" |
598 | | - t.string "name" |
599 | | - t.datetime "created_at", null: false |
600 | | - t.datetime "updated_at", null: false |
601 | | - t.string "versionable_id", limit: 36 |
602 | | - t.index ["versionable_id"], name: "index_question_identifiers_on_versionable_id" |
603 | | - end |
604 | | - |
605 | 378 | create_table "question_options", id: :serial, force: :cascade do |t| |
606 | 379 | t.integer "question_id" |
607 | 380 | t.string "text" |
|
776 | 549 | t.index ["subscriber_id", "subscriber_type", "plan_id"], name: "index_subscribers_on_identifiable_and_plan_id" |
777 | 550 | end |
778 | 551 |
|
779 | | - create_table "suggested_answers", id: :serial, force: :cascade do |t| |
780 | | - t.integer "question_id" |
781 | | - t.integer "organisation_id" |
782 | | - t.text "text" |
783 | | - t.datetime "created_at", precision: nil |
784 | | - t.datetime "updated_at", precision: nil |
785 | | - end |
786 | | - |
787 | 552 | create_table "templates", id: :serial, force: :cascade do |t| |
788 | 553 | t.string "title" |
789 | 554 | t.text "description" |
|
835 | 600 | t.index ["org_id"], name: "index_trackers_on_org_id" |
836 | 601 | end |
837 | 602 |
|
838 | | - create_table "user_org_roles", id: :serial, force: :cascade do |t| |
839 | | - t.integer "user_id" |
840 | | - t.integer "organisation_id" |
841 | | - t.integer "user_role_type_id" |
842 | | - t.datetime "created_at", precision: nil |
843 | | - t.datetime "updated_at", precision: nil |
844 | | - end |
845 | | - |
846 | | - create_table "user_role_types", id: :serial, force: :cascade do |t| |
847 | | - t.string "name" |
848 | | - t.text "description" |
849 | | - t.datetime "created_at", precision: nil |
850 | | - t.datetime "updated_at", precision: nil |
851 | | - end |
852 | | - |
853 | | - create_table "user_statuses", id: :serial, force: :cascade do |t| |
854 | | - t.string "name" |
855 | | - t.text "description" |
856 | | - t.datetime "created_at", precision: nil |
857 | | - t.datetime "updated_at", precision: nil |
858 | | - end |
859 | | - |
860 | | - create_table "user_types", id: :serial, force: :cascade do |t| |
861 | | - t.string "name" |
862 | | - t.text "description" |
863 | | - t.datetime "created_at", precision: nil |
864 | | - t.datetime "updated_at", precision: nil |
865 | | - end |
866 | | - |
867 | 603 | create_table "users", id: :serial, force: :cascade do |t| |
868 | 604 | t.string "firstname" |
869 | 605 | t.string "surname" |
|
912 | 648 | t.index ["user_id"], name: "index_users_perms_on_user_id" |
913 | 649 | end |
914 | 650 |
|
915 | | - create_table "users_roles", id: false, force: :cascade do |t| |
916 | | - t.integer "user_id" |
917 | | - t.integer "role_id" |
918 | | - t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id" |
919 | | - end |
920 | | - |
921 | | - create_table "versions", id: :serial, force: :cascade do |t| |
922 | | - t.string "title" |
923 | | - t.text "description" |
924 | | - t.integer "published" |
925 | | - t.integer "number" |
926 | | - t.integer "phase_id" |
927 | | - t.datetime "created_at", precision: nil |
928 | | - t.datetime "updated_at", precision: nil |
929 | | - t.index ["phase_id"], name: "index_versions_on_phase_id" |
930 | | - end |
931 | | - |
932 | 651 | add_foreign_key "annotations", "orgs" |
933 | 652 | add_foreign_key "annotations", "questions" |
934 | 653 | add_foreign_key "answers", "plans" |
|
941 | 660 | add_foreign_key "notes", "users" |
942 | 661 | add_foreign_key "notification_acknowledgements", "notifications" |
943 | 662 | add_foreign_key "notification_acknowledgements", "users" |
944 | | - add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id" |
945 | | - add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id" |
946 | 663 | add_foreign_key "org_domains", "orgs" |
947 | 664 | add_foreign_key "org_rors", "orgs" |
948 | 665 | add_foreign_key "org_token_permissions", "orgs" |
|
0 commit comments