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

Added clone, upgrade and integrate features to Chado installation from #119

Closed
wants to merge 26 commits into from

Conversation

guignonv
Copy link
Member

The Chado installation form has been widely modified in order to add several important features:

  1. an existing Chado schema can be cloned
  2. an existing Chado schema (any version) can be upgrade into Chado 1.3
  3. an existing Chado schema not created by Tripal (ie. schema loaded from an SQL dump) can be integrated into Tripal (must be upgrade to version 1.3)

Note: this patch includes changes on Chado schema name validation rules.

Some more details about the features:
The clone function relies on 2 SQL functions that are loaded from tripal_chado/chado_schema/pg-clone-schema/clone_schema.sql. It's added during Drupal update (drush updb) and removed when Tripal Chado is uninstalled. Those functions are part of an open source project with an MIT License compatible with Drupal licenses (see tripal_chado/chado_schema/pg-clone-schema/TRIPAL_README.md). I've contributed to that module to fix many missing or incorrect stuff. It clones a full schema with everything (ie. not just tables and their data). Very powerful.

The upgrade function does NOT use a "standard" SQL script that would just apply modifications between 1.2 and 1.3. It actually creates a "reference" schema of Chado 1.3 (no data in it) and compares the Chado schema to update with that reference and either process to the database update or just store all the upgrade queries in an SQL script that can be manually run by advanced users/admins. It can remove all the unnecessary stuff or try to leave it as is if "cleanup" is turned off on the web form. It is capable of adding missing foreign keys or constraints, update defaults, add missing comments, functions, etc.

guignonv and others added 25 commits June 18, 2021 15:29
Adjusted the Chado schema name validation rule for the installation in order to follow PostgreSQL rules.
In current implementation, underscores were forbidden while they are legal characters for schema names.
The new regex also allows diacritical marks and makes sure the name does not start with the reserved prefix "pg_".
fixed a quantifier: 1-letter names are also legal.
@guignonv guignonv mentioned this pull request Aug 12, 2021
@guignonv
Copy link
Member Author

This PR solves issue #119 .

@guignonv
Copy link
Member Author

guignonv commented Oct 5, 2021

This version works with the T4D8 main branch of August/September.
Fill free to merge it.

However, be aware that I refactored this code to work with my branch https://github.com/guignonv/t4d8/tree/9.x-4.x_Chado_API/ . If you plan to include the tripal_biodb layer, those features have already been refactored on that branch in the tripal_chado part (using the "task" system).

@guignonv
Copy link
Member Author

guignonv commented Oct 7, 2021

This has been superseded by PR #131.

@guignonv guignonv closed this Oct 7, 2021
@guignonv guignonv deleted the 9.x-4.x_Chado_import branch November 10, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant