Quellcode durchsuchen

Added update function to remove the job_id field from the tripal_import table

Stephen Ficklin vor 8 Jahren
Ursprung
Commit
1be9609522
1 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen
  1. 17 6
      tripal/tripal.install

+ 17 - 6
tripal/tripal.install

@@ -325,12 +325,6 @@ function tripal_tripal_import_schema() {
         'length' => 256,
         'not null' => TRUE,
       ),
-      'job_id' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => FALSE,
-        'description' => 'The job ID if the loaded was was imported using a Tripal job.'
-      ),
       'fid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -883,4 +877,21 @@ function tripal_update_7302() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not perform update: '. $error);
   }
+}
+
+/**
+ * Remove the job_id from the tripal import table.
+ */
+function tripal_update_7303() {
+  $transaction = db_transaction();
+  try {
+    if (db_field_exists('tripal_import', 'job_id')) {
+      db_drop_field('tripal_import', 'job_id');
+    }
+  }
+  catch (\PDOException $e) {
+    $transaction->rollback();
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
 }