Selaa lähdekoodia

Fixed upgrade functions to not use Tripal API as all modules must be disabled for D7 upgrade including tripal_core

Stephen Ficklin 11 vuotta sitten
vanhempi
commit
99f9447ea1

+ 11 - 3
tripal_contact/tripal_contact.install

@@ -230,7 +230,15 @@ function tripal_contact_add_custom_tables(){
  */
 function tripal_contact_update_7000() {
 
-  tripal_contact_add_cvs();
-  tripal_contact_add_cvterms();
-
+  // add the new contact_relationship_types vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+    'contact_relationship_types',
+    'Contains Types of relationships between contacts.')
+  ";
+  $success = db_query($sql);
+  if (!$success) {
+    throw new DrupalUpdateException('Failed to add contact_relationship_types CV');
+  }
 }

+ 2 - 2
tripal_library/tripal_library.install

@@ -259,8 +259,8 @@ function tripal_library_update_7000() {
   // 'tripal' CV.  It should be stored in the new library_property CV that
   // is added by this module for Tripal 2.0 and Drupal 7.  So, we need to
   // reset the CV ID for that term and rename the term to 'Library Description' 
-  // We cannot use the Tripal API calls'because during upgrade the tripal_core 
-  // should also be disabled
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
   $sql = "
     UPDATE chado.cvterm 
     SET 

+ 11 - 2
tripal_organism/tripal_organism.install

@@ -131,6 +131,15 @@ function tripal_organism_add_cvterms() {
  */
 function tripal_organism_update_7000() {
 
-  tripal_organism_add_cvs();
-  tripal_organism_add_cvterms();
+  // add the new organism_property vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+    'organism_property',
+    'Contains properties for organisms.')
+  ";
+  $success = db_query($sql);
+  if (!$success) {
+    throw new DrupalUpdateException('Failed to add organism_property CV');
+  }
 }

+ 0 - 18
tripal_project/tripal_project.install

@@ -124,21 +124,6 @@ function tripal_project_add_cvterms() {
     ),
     'project_property', 0, 1, 'tripal'
   );
-
-  tripal_cv_add_cvterm(
-    array(
-      'name' => 'Project Type',
-      'def'  => 'The short few word description of the type of project.'
-    ),
-   'project_property', 0, 1, 'tripal'
-  );
-  tripal_cv_add_cvterm(
-    array(
-      'name' => 'Funding Source',
-      'def'  => 'The funding source for this project.'
-    ),
-    'project_property', 0, 1, 'tripal'
-  );
 }
 
 /**
@@ -167,7 +152,4 @@ function tripal_project_update_7000() {
   if (!$success) {
     throw new DrupalUpdateException('Failed to move project properties to new project_property CV.');
   }
-
-  // add in new CVterms
-  tripal_project_add_cvterms();
 }

+ 11 - 2
tripal_pub/tripal_pub.install

@@ -247,6 +247,15 @@ function tripal_pub_add_cvterms() {
  */
 function tripal_pub_update_7000() {
 
-  tripal_pub_add_cvs();
-  tripal_pub_add_cvterms();
+  // add the new pub_relationship_types vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+    'pub_relationship_types',
+    'Contains Types of relationships between publications.')
+  ";
+  $success = db_query($sql);
+  if (!$success) {
+    throw new DrupalUpdateException('Failed to add pub_relationship_types CV');
+  }
 }