-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
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.
….x_schema_name_validation_fix
…lass as a static method.
…ct that new feature.
This reverts commit e9b7963.
This PR solves issue #119 . |
This version works with the T4D8 main branch of August/September. 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). |
This has been superseded by PR #131. |
The Chado installation form has been widely modified in order to add several important features:
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.