 CREATE TABLE drupal_node (
   drupal_node_id        INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
   experiment_id         INT(10),
-  autogene_txt          TEXT,
+  autogen_txt           TEXT,
   manual_txt            TEXT,
   metasum               CHAR(32),
   date                  TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   status                BOOLEAN DEFAULT True,
   
   KEY drupal_node_id_idx        (drupal_node_id),
-  KEY experiment_id_idx             (experiment_id),
+  KEY experiment_id_idx         (experiment_id),
   UNIQUE KEY                    (drupal_node_id, experiment_id)
 ) ENGINE=MyISAM;
+
+CREATE TRIGGER drupal_node_md5_upd_tr BEFORE UPDATE ON drupal_node
+  FOR EACH ROW SET NEW.metasum = MD5( CONCAT(NEW.autogen_txt, NEW.manual_txt) );
+CREATE TRIGGER drupal_node_md5_ins_tr BEFORE INSERT ON drupal_node
+  FOR EACH ROW SET NEW.metasum = MD5( CONCAT(NEW.autogen_txt, NEW.manual_txt) );
+

  UNIQUE KEY                  (run_id, experiment_id, run_sra_acc)
) ENGINE=MyISAM;


/**


  UNIQUE KEY                           (analysis_param_id, analysis_id)
) ENGINE=MyISAM;

CREATE TRIGGER analysis_param_md5_upd_tr BEFORE UPDATE ON analysis_param
  FOR EACH ROW SET NEW.metasum = MD5( CONCAT(NEW.in_file_id, NEW.out_file_id, NEW.program, NEW.parameters) );
CREATE TRIGGER analysis_param_md5_ins_tr BEFORE INSERT ON analysis_param
  FOR EACH ROW SET NEW.metasum = MD5( CONCAT(NEW.in_file_id, NEW.out_file_id, NEW.program, NEW.parameters) );

/**

