--- tw.install	Fri Jul 10 14:36:26 2009
+++ tw.install	Mon Aug 03 10:15:14 2009
@@ -255,4 +255,14 @@
     array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE,
           'default' => (int)FALSE));
   return $ret;
+}
+
+// Add a meta column to the tw_tables table
+function tw_update_6006() {
+  $ret = array();
+  db_add_field($ret, 'tw_tables', 'meta',
+    array('type' => 'text', 'size' => 'big', 'not null' => FALSE,
+      'description' => t('Serialized meta data about the table, such as a description.'),
+      'default' => NULL));
+  return $ret;
 }
\ No newline at end of file
--- tw_pages.inc	Thu Jul 16 11:17:19 2009
+++ tw_pages.inc	Mon Aug 03 10:34:23 2009
@@ -344,7 +344,7 @@
  * TODO: Flag any available FKs that are not indexed.
  */
 function tw_analysis($form_state, $twtid, $flag=TW_COLS_NOIGNORE) {
-  $row = db_fetch_object(db_query("SELECT dbconnection, tablename, existing_view_data
+  $row = db_fetch_object(db_query("SELECT dbconnection, tablename, existing_view_data, meta
                                    FROM {tw_tables}
                                    WHERE twtid=%d",
                                   $twtid));
@@ -360,7 +360,18 @@
   $form['twtid'] = array('#type' => 'value', '#value' => $twtid);
   $form['tablename'] = array('#type' => 'value', '#value' => $tablename);
   $form['existing_view_data'] = array('#type' => 'value', '#value' => $existing_view_data);
+  $form['dbconnection'] = array('#type' => 'value', '#value' => $dbconnection);
 
+  $meta = unserialize($row->meta);
+  $description = $meta['description'];
+
+  $form['table_description'] = array(
+    '#type' => 'textarea',
+    '#rows' => 2,
+    '#title' => t('Table Description'),
+    '#default_value' => check_plain($description),
+  );
+  
   switch ($flag) {
     case TW_COLS_ALL: 
       $flaglabel = t('All fields');
@@ -637,6 +648,7 @@
   $output .= '<div>' . drupal_render($form['colcounts']) . '</div>';
 
   $output .= drupal_render($form['help']);
+  $output .= '<div>' . drupal_render($form['table_description']) . '</div>';
 
   if (isset($form['colname']) && is_array($form['colname'])) {
     foreach (element_children($form['colname']) as $colname) {
@@ -675,6 +687,12 @@
  */
 function tw_analysis_submit($form, &$form_state) {
   $twtid = $form_state['values']['twtid'];
+  
+  $meta = array(
+    'description' => $form_state['values']['table_description'],
+  );
+  db_query("UPDATE {tw_tables} SET meta = '%s' WHERE twtid = %d", serialize($meta), $twtid);
+  
   foreach ($form_state['values']['cols'] as $key => $colname) {
     $newignore = $form_state['values']['ignorecol'][$colname] ? 1 : 0;
     $newavailablefk = $form_state['values']['availablefk'][$colname] ? 1 : 0;
