Index: trunk/psLib/src/dataIO/psDB.c
===================================================================
--- trunk/psLib/src/dataIO/psDB.c	(revision 3957)
+++ trunk/psLib/src/dataIO/psDB.c	(revision 3961)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-18 00:55:36 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-18 23:19:46 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -875,4 +875,7 @@
             return NULL;
         }
+        if (strstr(item->comment, "AUTO_INCREMENT")) {
+            psStringAppend(&query, "%s", " AUTO_INCREMENT");
+        }
 
         // add a , after every column declaration except the last one
@@ -886,7 +889,12 @@
     // find database indexes
     while ((item = psListGetAndIncrement(cursor))) {
-        if ((strncmp(item->comment, "Primary Key", strlen("Primary Key"))) == 0) {
+        // XXX NOTE: check for "Primary Key" first before "Key".  Yes we're
+        // playing fast and loose here, but I think it's fine...
+        if (strstr(item->comment, "Primary Key")) {
             psStringAppend(&query, ", PRIMARY KEY(%s)", item->name);
-        } else if ((strncmp(item->comment, "Key", strlen("Key"))) == 0) {
+        } else if (strstr(item->comment, "Key")) {
+            psStringAppend(&query, ", KEY(%s)", item->name);
+        } else if (strstr(item->comment, "AUTO_INCREMENT")) {
+            // this needs to be recognized as a key if it wasn't already
             psStringAppend(&query, ", KEY(%s)", item->name);
         }
