tripal
tripal copied to clipboard
Custom tables don't work with hook_chado_schema_v<version>_<table>
BUG/ERROR report
System information
- Tripal Version: 3.x
- Drupal Version: 7.x
- PostgreSQL Version: N/A
- PHP Version: N/A
Issue description
If you create a custom table (e.g. file
) during the install of an extension module (e.g. tripal_file) and then a second dependent extension module (e.g. tripal_network) adds a linker table (e.g. network_file
), the second module should be able to update the referring tables
key in the table schema. The normal approach is to implement hook_chado_schema_v<version>_<table>
and add the referring tables. However, this doesn't work for custom tables because the there is no original hook_chado_schema_v<version>_<table>
in the first module for the table because the table was added using the chado_create_custom_table
function.
We can get around this problem by adding a hook_chado_schema_v<version>_<table>
to the first extension module, but then we have to duplicate the table schema (in the hook and in the install file) or call the hook in the .install file to get the schema. Not sure what is best.
Steps to reproduce
Error messages and screenshots
error message