Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Cleanup #2818

Closed
briri opened this issue Feb 25, 2021 · 4 comments · Fixed by #3016
Closed

DB Cleanup #2818

briri opened this issue Feb 25, 2021 · 4 comments · Fixed by #3016

Comments

@briri
Copy link
Contributor

briri commented Feb 25, 2021

While writing up some DB schema info I realized we have some cleanup to do:

Be sure to update the wiki doc after these changes have been made!

Remove the following columns (once confirmed that they are no longer used):

  • answers.label_id
  • identifier_schemes.logo_url - logos are stored in the assets/images dir
  • RENAME orgs.feedback_email_msg to orgs.feedback_msg - Its no longer emailed!
  • orgs.feedback_email_subject - This is no longer an email the message is displayed on the page
  • orgs.is_other - Replaced by the managed flag and ROR API functionality
  • orgs.sort_name
  • plans.data_contact These are now stored in contributors
  • plans.data_contact_phone
  • plans.data_contact_email
  • plans.grant_number- This is now recorded via thegrant_id` fkey
  • plans.funder_name - This is now a recorded via the funder_id fkey
  • plans.principal_investigator - These are now stored in contributors
  • plans.principal_investigator_identifier
  • plans.principal_investigator_phone
  • plans.principal_investigator_email
  • research_outputs.coverage_region - Not going to be necessary
  • research_outputs.coverage_start - Not going to be necessary
  • research_outputs.coverage_end - Not going to be necessary
  • research_outputs.mandatory_attribution - Not going to be necessary
  • research_outputs.mime_type_id - Not going to be necessary
  • users.other_organization - Replaced by actual Orgs

Drop the following tables:

  • mime_types - It was meant for the ResearchOutputs functionality but is no longer necessary
  • org_identifiers - Those values are now stored in the identifiers polymorphic table
  • user_identifiers - Those values are now stored in the identifiers polymorphic table

Things to do after some research and refactor:

  • See if we need the settings table. It stores the font and margin settings a user specifies when exporting a plan. That info is carried through in the controller though and available there. There doesn't seem to be a need to store it.
@nicolasfranck
Copy link
Contributor

@briri if plan.funder_name will be removed, and the plan wizard requires an existing funding organisation, then it is not possible anymore to supply a custom value? Just something to know for my migration. This was since version 2.2.0 I believe?

@briri
Copy link
Contributor Author

briri commented Feb 25, 2021

The newer Org typeahead allows the user to type in their own value or select from a combination of an existing local DB record or an Org from the ROR API.

Here's a screenshot of what one of the Org typeaheads looks like:
Screen Shot 2021-02-25 at 12 51 54 PM

There are a few scenarios for Org selection depending on where they are located in the UI:

  • Allow for local DB, ROR or user entry - create account, profile page, contributor page, adding an Org (Super Admin)
  • Only from the local DB - Create plan (because it dictates template selection), Templates page (when Super Admin is changing their Org)
  • Only funders from the local DB - Selecting a funder from the Create plan page

For an easy way to disable the ROR integration, for your use case since you have a restricted set of Orgs if I remember corretly, would be to set the config/initializers/external_apis/ror.rb initialize to 'inactive' This will switch it to only allow local DB and user entered values.

I suppose I should add a wiki page about this ;)

@pherterich
Copy link

@raycarrick-ed to run on DMPonline

@briri
Copy link
Contributor Author

briri commented Oct 1, 2021

Did not end up removing orgs.is_other and users.other_organization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants