function tripal_cv_install
2.x tripal_cv.install | tripal_cv_install() |
3.x tripal_cv.install | tripal_cv_install() |
1.x tripal_cv.install | tripal_cv_install() |
Implementation of hook_install().
Related topics
File
- tripal_cv/
tripal_cv.install, line 13 - Contains functions executed only on install/uninstall of this module
Code
function tripal_cv_install() {
// create the module's data directory
tripal_create_moddir('tripal_cv');
// Create the MView
tripal_add_mview(
// view name
'cv_root_mview',
// module name
'tripal_cv',
// table name
'cv_root_mview',
// table schema
'name character varying(1024), cvterm_id integer, cv_id integer,
cv_name character varying(255)',
// indexed columns
'cvterm_id, cv_id',
// SQL statement that populates the view
'SELECT DISTINCT CVT.name,CVT.cvterm_id, CV.cv_id, CV.name
FROM {cvterm_relationship} CVTR
INNER JOIN cvterm CVT on CVTR.object_id = CVT.cvterm_id
INNER JOIN CV on CV.cv_id = CVT.cv_id
WHERE CVTR.object_id not in
(SELECT subject_id FROM {cvterm_relationship}) ',
// special index
''
);
// create the tables that correlate OBO files/references with a chado CV
drupal_install_schema('tripal_cv');
tripal_cv_add_obo_defaults();
}