diff --git a/app/models/annotation.rb b/app/models/annotation.rb index d5799565b4..8899501143 100644 --- a/app/models/annotation.rb +++ b/app/models/annotation.rb @@ -6,7 +6,7 @@ # # id :integer not null, primary key # text :text -# type :integer default(0), not null +# type :integer default("example_answer"), not null # created_at :datetime # updated_at :datetime # org_id :integer diff --git a/app/models/answer.rb b/app/models/answer.rb index 9a4dcb4d14..138e2ed956 100644 --- a/app/models/answer.rb +++ b/app/models/answer.rb @@ -15,9 +15,7 @@ # # Indexes # -# fk_rails_3d5ed4418f (question_id) # fk_rails_584be190c2 (user_id) -# fk_rails_84a6005a3e (plan_id) # index_answers_on_plan_id (plan_id) # index_answers_on_question_id (question_id) # diff --git a/app/models/api_client.rb b/app/models/api_client.rb index 0c20193c53..b4c1a41265 100644 --- a/app/models/api_client.rb +++ b/app/models/api_client.rb @@ -4,25 +4,23 @@ # # Table name: api_clients # -# id :integer not null, primary key -# name :string, not null -# homepage :string -# contact_name :string -# contact_email :string, not null -# client_id :string, not null -# client_secret :string, not null -# last_access :datetime -# created_at :datetime -# updated_at :datetime -# org_id :integer +# id :integer not null, primary key +# client_secret :string not null +# contact_email :string not null +# contact_name :string +# description :string +# homepage :string +# last_access :datetime +# name :string not null +# created_at :datetime not null +# updated_at :datetime not null +# client_id :string not null +# org_id :integer # # Indexes # -# index_api_clients_on_name (name) +# index_api_clients_on_name (name) # -# Foreign Keys -# -# fk_rails_... (org_id => orgs.id) # Object that represents an external system class ApiClient < ApplicationRecord diff --git a/app/models/condition.rb b/app/models/condition.rb index ef0d79cca3..44ff5c2e4f 100644 --- a/app/models/condition.rb +++ b/app/models/condition.rb @@ -4,15 +4,15 @@ # # Table name: conditions # -# id :integer not null, primary key -# question_id :integer -# number :integer -# action_type :integer -# option_list :text -# remove_data :text -# webhook_data :text -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# action_type :integer +# number :integer +# option_list :text +# remove_data :text +# webhook_data :text +# created_at :datetime not null +# updated_at :datetime not null +# question_id :integer # # Indexes # @@ -20,8 +20,7 @@ # # Foreign Keys # -# fk_rails_... (question_id => question.id) -# +# fk_rails_... (question_id => questions.id) # # Object that represents a condition of a conditional question diff --git a/app/models/contributor.rb b/app/models/contributor.rb index 739d40aae7..0f38e9941f 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -4,27 +4,23 @@ # # Table name: contributors # -# id :integer not null, primary key -# firstname :string -# surname :string -# email :string -# phone :string -# roles :integer -# org_id :integer -# plan_id :integer -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# email :string +# name :string +# phone :string +# roles :integer not null +# created_at :datetime +# updated_at :datetime +# org_id :integer +# plan_id :integer not null # # Indexes # -# index_contributors_on_id (id) -# index_contributors_on_email (email) -# index_contributors_on_org_id (org_id) +# index_contributors_on_email (email) +# index_contributors_on_org_id (org_id) +# index_contributors_on_plan_id (plan_id) +# index_contributors_on_roles (roles) # -# Foreign Keys -# -# fk_rails_... (org_id => orgs.id) -# fk_rails_... (plan_id => plans.id) # Object that represents a contributor to a plan class Contributor < ApplicationRecord diff --git a/app/models/guidance_group.rb b/app/models/guidance_group.rb index c108cea48e..98d757f4a2 100644 --- a/app/models/guidance_group.rb +++ b/app/models/guidance_group.rb @@ -9,7 +9,7 @@ # # id :integer not null, primary key # name :string -# optional_subset :boolean default(FALSE), not null +# optional_subset :boolean default(TRUE), not null # published :boolean default(FALSE), not null # created_at :datetime not null # updated_at :datetime not null diff --git a/app/models/identifier.rb b/app/models/identifier.rb index 9b7236407a..c8329bcd7a 100644 --- a/app/models/identifier.rb +++ b/app/models/identifier.rb @@ -11,11 +11,13 @@ # created_at :datetime # updated_at :datetime # identifiable_id :integer -# identifier_scheme_id :integer not null +# identifier_scheme_id :integer # # Indexes # # index_identifiers_on_identifiable_type_and_identifiable_id (identifiable_type,identifiable_id) +# index_identifiers_on_identifier_scheme_id_and_value (identifier_scheme_id,value) +# index_identifiers_on_scheme_and_type_and_id (identifier_scheme_id,identifiable_id,identifiable_type) # # Object that represents an identifier for an object diff --git a/app/models/identifier_scheme.rb b/app/models/identifier_scheme.rb index fecfd22419..4fade2a63b 100644 --- a/app/models/identifier_scheme.rb +++ b/app/models/identifier_scheme.rb @@ -4,15 +4,16 @@ # # Table name: identifier_schemes # -# id :integer not null, primary key -# active :boolean -# description :string -# context :integer -# logo_url :text -# name :string -# user_landing_url :string -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# active :boolean +# context :integer +# description :string +# external_service :string +# identifier_prefix :text +# logo_url :text +# name :string +# created_at :datetime +# updated_at :datetime # # Object that represents a type of identifiaction (e.g. ORCID, ROR, etc.) diff --git a/app/models/license.rb b/app/models/license.rb index e59f74250d..1668a62010 100644 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -4,7 +4,7 @@ # # Table name: licenses # -# id :bigint not null, primary key +# id :bigint(8) not null, primary key # deprecated :boolean default(FALSE) # identifier :string not null # name :string not null diff --git a/app/models/metadata_standard.rb b/app/models/metadata_standard.rb index 02eaccfd1f..ca546a5255 100644 --- a/app/models/metadata_standard.rb +++ b/app/models/metadata_standard.rb @@ -4,15 +4,15 @@ # # Table name: metadata_standards # -# id :bigint not null, primary key -# description :text -# locations :json -# related_entities :json -# title :string -# uri :string -# created_at :datetime not null -# updated_at :datetime not null -# rdamsc_id :string +# id :bigint(8) not null, primary key +# description :text +# locations :json +# related_entities :json +# title :string +# uri :string +# created_at :datetime not null +# updated_at :datetime not null +# rdamsc_id :string # class MetadataStandard < ApplicationRecord # ============= diff --git a/app/models/notification.rb b/app/models/notification.rb index b26be026f7..fc8ac7927d 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -7,12 +7,12 @@ # id :integer not null, primary key # body :text # dismissable :boolean +# enabled :boolean default(TRUE) # expires_at :date # level :integer # notification_type :integer # starts_at :date # title :string -# enabled :boolean # created_at :datetime not null # updated_at :datetime not null # diff --git a/app/models/org.rb b/app/models/org.rb index 3d9a526967..ec6db60665 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -4,31 +4,38 @@ # # Table name: orgs # -# id :integer not null, primary key -# abbreviation :string -# contact_email :string -# contact_name :string -# feedback_msg :text -# feedback_enabled :boolean default(FALSE) -# is_other :boolean default(FALSE), not null -# links :text -# logo_name :string -# logo_uid :string -# managed :boolean default(FALSE), not null -# name :string -# org_type :integer default(0), not null -# sort_name :string -# target_url :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :integer -# region_id :integer -# managed :boolean default(false), not null -# helpdesk_email :string +# id :integer not null, primary key +# abbreviation :string +# banner_name :string +# banner_uid :string +# contact_email :string +# contact_name :string +# display_in_registration :boolean +# feedback_enabled :boolean default(FALSE) +# feedback_msg :text +# helpdesk_email :string +# is_other :boolean default(FALSE), not null +# links :text +# logo_name :string +# logo_uid :string +# managed :boolean default(FALSE), not null +# name :string +# org_type :integer default(0), not null +# target_url :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :integer +# region_id :integer +# +# Indexes +# +# fk_rails_5640112cab (language_id) +# fk_rails_5a6adf6bab (region_id) # # Foreign Keys # # fk_rails_... (language_id => languages.id) +# fk_rails_... (region_id => regions.id) # # Object that represents an Organization/Institution/Funder diff --git a/app/models/plan.rb b/app/models/plan.rb index ec6159613f..f95f33c009 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -7,37 +7,39 @@ # # Table name: plans # -# id :integer not null, primary key -# complete :boolean default(FALSE) -# description :text -# feedback_requested :boolean default(FALSE) -# identifier :string -# title :string -# visibility :integer default(3), not null -# created_at :datetime -# updated_at :datetime -# template_id :integer -# org_id :integer -# funder_id :integer -# grant_id :integer -# research_domain_id :bigint -# funding_status :integer -# ethical_issues :boolean -# ethical_issues_description :text -# ethical_issues_report :string +# id :integer not null, primary key +# complete :boolean default(FALSE) +# description :text +# end_date :datetime +# ethical_issues :boolean +# ethical_issues_description :text +# ethical_issues_report :string +# feedback_requested :boolean default(FALSE) +# funding_status :integer +# identifier :string +# start_date :datetime +# title :string +# visibility :integer default("privately_visible"), not null +# created_at :datetime +# updated_at :datetime +# funder_id :integer +# grant_id :integer +# org_id :integer +# research_domain_id :bigint(8) +# template_id :integer # # Indexes # -# index_plans_on_template_id (template_id) -# index_plans_on_funder_id (funder_id) -# index_plans_on_grant_id (grant_id) -# index_plans_on_api_client_id (api_client_id) +# index_plans_on_funder_id (funder_id) +# index_plans_on_grant_id (grant_id) +# index_plans_on_org_id (org_id) +# index_plans_on_research_domain_id (research_domain_id) +# index_plans_on_template_id (template_id) # # Foreign Keys # -# fk_rails_... (template_id => templates.id) # fk_rails_... (org_id => orgs.id) -# fk_rails_... (research_domain_id => research_domains.id) +# fk_rails_... (template_id => templates.id) # # Object that represents an DMP diff --git a/app/models/question_format.rb b/app/models/question_format.rb index 7247d4898f..3921cc20d2 100644 --- a/app/models/question_format.rb +++ b/app/models/question_format.rb @@ -6,7 +6,7 @@ # # id :integer not null, primary key # description :text -# formattype :integer default(0) +# formattype :integer default("textarea") # option_based :boolean default(FALSE) # title :string # created_at :datetime not null diff --git a/app/models/question_option.rb b/app/models/question_option.rb index 6eabdd7ae7..785ccc34b4 100644 --- a/app/models/question_option.rb +++ b/app/models/question_option.rb @@ -4,17 +4,19 @@ # # Table name: question_options # -# id :integer not null, primary key -# is_default :boolean -# number :integer -# text :string -# created_at :datetime -# updated_at :datetime -# question_id :integer +# id :integer not null, primary key +# is_default :boolean +# number :integer +# text :string +# created_at :datetime +# updated_at :datetime +# question_id :integer +# versionable_id :string(36) # # Indexes # -# index_question_options_on_question_id (question_id) +# index_question_options_on_question_id (question_id) +# index_question_options_on_versionable_id (versionable_id) # # Foreign Keys # diff --git a/app/models/region.rb b/app/models/region.rb index 514671e44d..a191b8db31 100644 --- a/app/models/region.rb +++ b/app/models/region.rb @@ -4,12 +4,11 @@ # # Table name: regions # -# id :integer not null, primary key -# abbreviation :string -# description :string -# name :string not null -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# abbreviation :string +# description :string +# name :string +# super_region_id :integer # # Object that represents a regional area diff --git a/app/models/repository.rb b/app/models/repository.rb index 344dcb889b..32190e0a18 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -4,23 +4,22 @@ # # Table name: repositories # -# id :bigint not null, primary key +# id :bigint(8) not null, primary key # contact :string # description :text not null +# homepage :string # info :json # name :string not null -# homepage :string +# uri :string not null # created_at :datetime not null # updated_at :datetime not null -# uri :string not null # # Indexes # -# index_repositories_on_name (name) -# index_repositories_on_homepage (homepage) -# index_repositories_on_uri (uri) +# index_repositories_on_homepage (homepage) +# index_repositories_on_name (name) +# index_repositories_on_uri (uri) # -# Object that represents a research output repository (e.g. GitHub or Zenodo) class Repository < ApplicationRecord # ============= # = Constants = diff --git a/app/models/research_domain.rb b/app/models/research_domain.rb index 850842cb97..bd9950f52b 100644 --- a/app/models/research_domain.rb +++ b/app/models/research_domain.rb @@ -4,12 +4,12 @@ # # Table name: research_domains # -# id :bigint not null, primary key -# identifier :string not null -# label :string not null -# created_at :datetime not null -# updated_at :datetime not null -# parent_id :bigint +# id :bigint(8) not null, primary key +# identifier :string not null +# label :string not null +# created_at :datetime not null +# updated_at :datetime not null +# parent_id :bigint(8) # # Indexes # diff --git a/app/models/research_output.rb b/app/models/research_output.rb index f1bef1f16b..32b03fa7f1 100644 --- a/app/models/research_output.rb +++ b/app/models/research_output.rb @@ -4,10 +4,10 @@ # # Table name: research_outputs # -# id :bigint not null, primary key +# id :bigint(8) not null, primary key # abbreviation :string # access :integer default("open"), not null -# byte_size :bigint +# byte_size :bigint(8) # description :text # display_order :integer # is_default :boolean @@ -19,16 +19,17 @@ # title :string not null # created_at :datetime not null # updated_at :datetime not null -# license_id :bigint +# license_id :bigint(8) # plan_id :integer # # Indexes # +# index_research_outputs_on_license_id (license_id) # index_research_outputs_on_output_type (output_type) +# index_research_outputs_on_plan_id (plan_id) # # Foreign Keys # -# fk_rails_... (plan_id => plans.id) # fk_rails_... (license_id => licenses.id) # diff --git a/app/models/tracker.rb b/app/models/tracker.rb index 7e62838d12..9d9f6176be 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -1,5 +1,23 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: trackers +# +# id :integer not null, primary key +# code :string +# created_at :datetime not null +# updated_at :datetime not null +# org_id :integer +# +# Indexes +# +# index_trackers_on_org_id (org_id) +# +# Foreign Keys +# +# fk_rails_... (org_id => orgs.id) +# # Object that represents a Google Analytics tracker code class Tracker < ApplicationRecord belongs_to :org diff --git a/app/models/user.rb b/app/models/user.rb index fe9579eb79..3df931fc38 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,17 +13,19 @@ # confirmed_at :datetime # current_sign_in_at :datetime # current_sign_in_ip :string +# dmponline3 :boolean # email :string(80) default(""), not null -# encrypted_password :string +# encrypted_password :string default("") # firstname :string # invitation_accepted_at :datetime # invitation_created_at :datetime # invitation_sent_at :datetime # invitation_token :string # invited_by_type :string +# last_api_access :datetime # last_sign_in_at :datetime # last_sign_in_ip :string -# other_organisation :string +# other_organisation :string # recovery_email :string # remember_created_at :datetime # reset_password_sent_at :datetime @@ -41,7 +43,7 @@ # # fk_rails_45f4f12508 (language_id) # fk_rails_f29bf9cdf2 (department_id) -# index_users_on_email (email) +# index_users_on_email (email) UNIQUE # index_users_on_org_id (org_id) # # Foreign Keys diff --git a/spec/factories/annotations.rb b/spec/factories/annotations.rb index 479c4d9c02..c57c5f5379 100644 --- a/spec/factories/annotations.rb +++ b/spec/factories/annotations.rb @@ -6,7 +6,7 @@ # # id :integer not null, primary key # text :text -# type :integer default(0), not null +# type :integer default("example_answer"), not null # created_at :datetime # updated_at :datetime # org_id :integer diff --git a/spec/factories/answers.rb b/spec/factories/answers.rb index 447c549bb1..3b4e3fde11 100644 --- a/spec/factories/answers.rb +++ b/spec/factories/answers.rb @@ -15,9 +15,7 @@ # # Indexes # -# fk_rails_3d5ed4418f (question_id) # fk_rails_584be190c2 (user_id) -# fk_rails_84a6005a3e (plan_id) # index_answers_on_plan_id (plan_id) # index_answers_on_question_id (question_id) # diff --git a/spec/factories/api_clients.rb b/spec/factories/api_clients.rb index b5ea773667..d18c1cfc2f 100644 --- a/spec/factories/api_clients.rb +++ b/spec/factories/api_clients.rb @@ -4,25 +4,23 @@ # # Table name: api_clients # -# id :integer not null, primary key -# name :string, not null -# homepage :string -# contact_name :string -# contact_email :string, not null -# client_id :string, not null -# client_secret :string, not null -# last_access :datetime -# created_at :datetime -# updated_at :datetime -# org_id :integer +# id :integer not null, primary key +# client_secret :string not null +# contact_email :string not null +# contact_name :string +# description :string +# homepage :string +# last_access :datetime +# name :string not null +# created_at :datetime not null +# updated_at :datetime not null +# client_id :string not null +# org_id :integer # # Indexes # -# index_api_clients_on_name (name) +# index_api_clients_on_name (name) # -# Foreign Keys -# -# fk_rails_... (org_id => orgs.id) FactoryBot.define do factory :api_client do diff --git a/spec/factories/conditions.rb b/spec/factories/conditions.rb index afaf5fdea2..ff6fcd221a 100644 --- a/spec/factories/conditions.rb +++ b/spec/factories/conditions.rb @@ -4,15 +4,15 @@ # # Table name: conditions # -# id :integer not null, primary key -# question_id :integer -# number :integer -# action_type :integer -# option_list :text -# remove_data :text -# webhook_data :text -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# action_type :integer +# number :integer +# option_list :text +# remove_data :text +# webhook_data :text +# created_at :datetime not null +# updated_at :datetime not null +# question_id :integer # # Indexes # @@ -20,8 +20,7 @@ # # Foreign Keys # -# fk_rails_... (question_id => question.id) -# +# fk_rails_... (question_id => questions.id) # FactoryBot.define do diff --git a/spec/factories/contributors.rb b/spec/factories/contributors.rb index c0f3e16f73..155a31b1fe 100644 --- a/spec/factories/contributors.rb +++ b/spec/factories/contributors.rb @@ -4,26 +4,23 @@ # # Table name: contributors # -# id :integer not null, primary key -# name :string -# email :string -# phone :string -# roles :integer -# org_id :integer -# plan_id :integer -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# email :string +# name :string +# phone :string +# roles :integer not null +# created_at :datetime +# updated_at :datetime +# org_id :integer +# plan_id :integer not null # # Indexes # -# index_contributors_on_id (id) -# index_contributors_on_email (email) -# index_contributors_on_org_id (org_id) +# index_contributors_on_email (email) +# index_contributors_on_org_id (org_id) +# index_contributors_on_plan_id (plan_id) +# index_contributors_on_roles (roles) # -# Foreign Keys -# -# fk_rails_... (org_id => orgs.id) -# fk_rails_... (plan_id => plans.id) FactoryBot.define do factory :contributor do diff --git a/spec/factories/guidance_groups.rb b/spec/factories/guidance_groups.rb index 2a7fd88a1e..3409db79d9 100644 --- a/spec/factories/guidance_groups.rb +++ b/spec/factories/guidance_groups.rb @@ -6,7 +6,7 @@ # # id :integer not null, primary key # name :string -# optional_subset :boolean default(FALSE), not null +# optional_subset :boolean default(TRUE), not null # published :boolean default(FALSE), not null # created_at :datetime not null # updated_at :datetime not null diff --git a/spec/factories/identifier_schemes.rb b/spec/factories/identifier_schemes.rb index d9e3de64bb..8d78e1827b 100644 --- a/spec/factories/identifier_schemes.rb +++ b/spec/factories/identifier_schemes.rb @@ -6,11 +6,12 @@ # # id :integer not null, primary key # active :boolean -# description :string # context :integer +# description :string +# external_service :string +# identifier_prefix :text # logo_url :text # name :string -# identifier_prefix :string # created_at :datetime # updated_at :datetime # diff --git a/spec/factories/identifiers.rb b/spec/factories/identifiers.rb index 49d4a1b832..7ef6b26864 100644 --- a/spec/factories/identifiers.rb +++ b/spec/factories/identifiers.rb @@ -11,11 +11,13 @@ # created_at :datetime # updated_at :datetime # identifiable_id :integer -# identifier_scheme_id :integer not null +# identifier_scheme_id :integer # # Indexes # # index_identifiers_on_identifiable_type_and_identifiable_id (identifiable_type,identifiable_id) +# index_identifiers_on_identifier_scheme_id_and_value (identifier_scheme_id,value) +# index_identifiers_on_scheme_and_type_and_id (identifier_scheme_id,identifiable_id,identifiable_type) # FactoryBot.define do diff --git a/spec/factories/licenses.rb b/spec/factories/licenses.rb index 3564d800c5..02de62c86c 100644 --- a/spec/factories/licenses.rb +++ b/spec/factories/licenses.rb @@ -4,7 +4,7 @@ # # Table name: licenses # -# id :bigint not null, primary key +# id :bigint(8) not null, primary key # deprecated :boolean default(FALSE) # identifier :string not null # name :string not null diff --git a/spec/factories/metadata_standards.rb b/spec/factories/metadata_standards.rb index ca8136b37e..9af28d9a40 100644 --- a/spec/factories/metadata_standards.rb +++ b/spec/factories/metadata_standards.rb @@ -4,15 +4,15 @@ # # Table name: metadata_standards # -# id :bigint not null, primary key -# description :text -# locations :json -# related_entities :json -# title :string -# uri :string -# created_at :datetime not null -# updated_at :datetime not null -# rdamsc_id :string +# id :bigint(8) not null, primary key +# description :text +# locations :json +# related_entities :json +# title :string +# uri :string +# created_at :datetime not null +# updated_at :datetime not null +# rdamsc_id :string # FactoryBot.define do factory :metadata_standard do diff --git a/spec/factories/notifications.rb b/spec/factories/notifications.rb index cf6c130195..947f185257 100644 --- a/spec/factories/notifications.rb +++ b/spec/factories/notifications.rb @@ -7,12 +7,12 @@ # id :integer not null, primary key # body :text # dismissable :boolean +# enabled :boolean default(TRUE) # expires_at :date # level :integer # notification_type :integer # starts_at :date # title :string -# enable :boolean # created_at :datetime not null # updated_at :datetime not null # diff --git a/spec/factories/orgs.rb b/spec/factories/orgs.rb index 88bc858b0b..f523683852 100644 --- a/spec/factories/orgs.rb +++ b/spec/factories/orgs.rb @@ -4,31 +4,38 @@ # # Table name: orgs # -# id :integer not null, primary key -# abbreviation :string -# contact_email :string -# contact_name :string -# feedback_msg :text -# feedback_enabled :boolean default(FALSE) -# is_other :boolean default(FALSE), not null -# links :text -# logo_name :string -# logo_uid :string -# managed :boolean default(FALSE), not null -# name :string -# org_type :integer default(0), not null -# target_url :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :integer +# id :integer not null, primary key +# abbreviation :string +# banner_name :string +# banner_uid :string +# contact_email :string +# contact_name :string +# display_in_registration :boolean +# feedback_enabled :boolean default(FALSE) +# feedback_msg :text +# helpdesk_email :string +# is_other :boolean default(FALSE), not null +# links :text +# logo_name :string +# logo_uid :string +# managed :boolean default(FALSE), not null +# name :string +# org_type :integer default(0), not null +# target_url :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :integer +# region_id :integer # # Indexes # # fk_rails_5640112cab (language_id) +# fk_rails_5a6adf6bab (region_id) # # Foreign Keys # # fk_rails_... (language_id => languages.id) +# fk_rails_... (region_id => regions.id) # FactoryBot.define do diff --git a/spec/factories/plans.rb b/spec/factories/plans.rb index c07d002ec7..fca59f68ba 100644 --- a/spec/factories/plans.rb +++ b/spec/factories/plans.rb @@ -4,39 +4,39 @@ # # Table name: plans # -# id :integer not null, primary key -# complete :boolean default(FALSE) -# description :text -# ethical_issues :boolean -# ethical_issues_description :text -# ethical_issues_report :string -# feedback_requested :boolean default(FALSE) -# funding_status :integer -# identifier :string -# title :string -# visibility :integer default(3), not null -# created_at :datetime -# updated_at :datetime -# template_id :integer -# org_id :integer -# funder_id :integer -# grant_id :integer -# api_client_id :integer -# research_domain_id :bigint +# id :integer not null, primary key +# complete :boolean default(FALSE) +# description :text +# end_date :datetime +# ethical_issues :boolean +# ethical_issues_description :text +# ethical_issues_report :string +# feedback_requested :boolean default(FALSE) +# funding_status :integer +# identifier :string +# start_date :datetime +# title :string +# visibility :integer default("privately_visible"), not null +# created_at :datetime +# updated_at :datetime +# funder_id :integer +# grant_id :integer +# org_id :integer +# research_domain_id :bigint(8) +# template_id :integer # # Indexes # -# index_plans_on_template_id (template_id) -# index_plans_on_funder_id (funder_id) -# index_plans_on_grant_id (grant_id) -# index_plans_on_api_client_id (api_client_id) +# index_plans_on_funder_id (funder_id) +# index_plans_on_grant_id (grant_id) +# index_plans_on_org_id (org_id) +# index_plans_on_research_domain_id (research_domain_id) +# index_plans_on_template_id (template_id) # # Foreign Keys # -# fk_rails_... (template_id => templates.id) # fk_rails_... (org_id => orgs.id) -# fk_rails_... (api_client_id => api_clients.id) -# fk_rails_... (research_domain_id => research_domains.id) +# fk_rails_... (template_id => templates.id) # FactoryBot.define do diff --git a/spec/factories/question_formats.rb b/spec/factories/question_formats.rb index 63dc8c70d6..6668fd847f 100644 --- a/spec/factories/question_formats.rb +++ b/spec/factories/question_formats.rb @@ -6,7 +6,7 @@ # # id :integer not null, primary key # description :text -# formattype :integer default(0) +# formattype :integer default("textarea") # option_based :boolean default(FALSE) # title :string # created_at :datetime not null diff --git a/spec/factories/question_options.rb b/spec/factories/question_options.rb index 415d55537a..b973d24809 100644 --- a/spec/factories/question_options.rb +++ b/spec/factories/question_options.rb @@ -4,17 +4,19 @@ # # Table name: question_options # -# id :integer not null, primary key -# is_default :boolean -# number :integer -# text :string -# created_at :datetime -# updated_at :datetime -# question_id :integer +# id :integer not null, primary key +# is_default :boolean +# number :integer +# text :string +# created_at :datetime +# updated_at :datetime +# question_id :integer +# versionable_id :string(36) # # Indexes # -# index_question_options_on_question_id (question_id) +# index_question_options_on_question_id (question_id) +# index_question_options_on_versionable_id (versionable_id) # # Foreign Keys # diff --git a/spec/factories/regions.rb b/spec/factories/regions.rb index 81148dc330..258799784b 100644 --- a/spec/factories/regions.rb +++ b/spec/factories/regions.rb @@ -4,12 +4,11 @@ # # Table name: regions # -# id :integer not null, primary key -# abbreviation :string -# description :string -# name :string not null -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# abbreviation :string +# description :string +# name :string +# super_region_id :integer # FactoryBot.define do diff --git a/spec/factories/repositories.rb b/spec/factories/repositories.rb index 922a8a47b2..4bcceb2a65 100644 --- a/spec/factories/repositories.rb +++ b/spec/factories/repositories.rb @@ -4,21 +4,21 @@ # # Table name: repositories # -# id :bigint not null, primary key +# id :bigint(8) not null, primary key # contact :string # description :text not null +# homepage :string # info :json # name :string not null -# homepage :string +# uri :string not null # created_at :datetime not null # updated_at :datetime not null -# uri :string not null # # Indexes # -# index_repositories_on_name (name) -# index_repositories_on_url (homepage) -# index_repositories_on_url (uri) +# index_repositories_on_homepage (homepage) +# index_repositories_on_name (name) +# index_repositories_on_uri (uri) # FactoryBot.define do factory :repository do diff --git a/spec/factories/research_domains.rb b/spec/factories/research_domains.rb index 7d4017f924..0823ed3d12 100644 --- a/spec/factories/research_domains.rb +++ b/spec/factories/research_domains.rb @@ -5,15 +5,15 @@ # Table name: research_domains # # id :bigint(8) not null, primary key -# identifier :string(255) not null -# label :string(255) not null +# identifier :string not null +# label :string not null # created_at :datetime not null # updated_at :datetime not null # parent_id :bigint(8) # # Indexes # -# index_research_domain_on_parent_id (parent_id) +# index_research_domains_on_parent_id (parent_id) # # Foreign Keys # diff --git a/spec/factories/research_outputs.rb b/spec/factories/research_outputs.rb index 4f62a881a1..56a21119ea 100644 --- a/spec/factories/research_outputs.rb +++ b/spec/factories/research_outputs.rb @@ -5,18 +5,18 @@ # Table name: research_outputs # # id :bigint(8) not null, primary key -# abbreviation :string(255) +# abbreviation :string # access :integer default("open"), not null # byte_size :bigint(8) -# description :text(65535) +# description :text # display_order :integer # is_default :boolean # output_type :integer default("dataset"), not null -# output_type_description :string(255) +# output_type_description :string # personal_data :boolean # release_date :datetime # sensitive_data :boolean -# title :string(255) not null +# title :string not null # created_at :datetime not null # updated_at :datetime not null # license_id :bigint(8) @@ -28,6 +28,10 @@ # index_research_outputs_on_output_type (output_type) # index_research_outputs_on_plan_id (plan_id) # +# Foreign Keys +# +# fk_rails_... (license_id => licenses.id) +# FactoryBot.define do factory :research_output do license diff --git a/spec/factories/trackers.rb b/spec/factories/trackers.rb index 875480d4e1..448b92e02b 100644 --- a/spec/factories/trackers.rb +++ b/spec/factories/trackers.rb @@ -1,5 +1,23 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: trackers +# +# id :integer not null, primary key +# code :string +# created_at :datetime not null +# updated_at :datetime not null +# org_id :integer +# +# Indexes +# +# index_trackers_on_org_id (org_id) +# +# Foreign Keys +# +# fk_rails_... (org_id => orgs.id) +# FactoryBot.define do factory :tracker do org { nil } diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 143c3f1c9c..1cf3cfdac1 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -13,14 +13,16 @@ # confirmed_at :datetime # current_sign_in_at :datetime # current_sign_in_ip :string +# dmponline3 :boolean # email :string(80) default(""), not null -# encrypted_password :string +# encrypted_password :string default("") # firstname :string # invitation_accepted_at :datetime # invitation_created_at :datetime # invitation_sent_at :datetime # invitation_token :string # invited_by_type :string +# last_api_access :datetime # last_sign_in_at :datetime # last_sign_in_ip :string # other_organisation :string @@ -41,7 +43,7 @@ # # fk_rails_45f4f12508 (language_id) # fk_rails_f29bf9cdf2 (department_id) -# index_users_on_email (email) +# index_users_on_email (email) UNIQUE # index_users_on_org_id (org_id) # # Foreign Keys