Index: /trunk/FACT++/src/fits2sql.cc
===================================================================
--- /trunk/FACT++/src/fits2sql.cc	(revision 19190)
+++ /trunk/FACT++/src/fits2sql.cc	(revision 19191)
@@ -198,4 +198,7 @@
         "with the --index option.\n"
         "\n"
+        "To create the index as a UNIQUE INDEX, you can use the --unique option which "
+        "implies --index.\n"
+        "\n"
         "If a query failed, the query is printed to stderr together with the error message. "
         "For the main INSERT query, this is only true if the verbosity level is at least 2 "
@@ -325,4 +328,5 @@
     const bool run_delete        = conf.Get<bool>("delete");
     const bool index             = conf.Get<bool>("index");
+    const bool unique            = conf.Get<bool>("unique");
 
     const string engine          = conf.Get<string>("engine");
@@ -592,6 +596,6 @@
         query += ",\n   PRIMARY KEY USING BTREE (`"+boost::algorithm::join(primary, "`, `")+"`)";
 
-    if (!vindex.empty() && index)
-        query += ",\n   INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)";
+    if (!vindex.empty() && (index || unique))
+        query += ",\n   "+string(unique?"UNIQUE ":"")+"INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)";
 
     query +=
Index: /trunk/FACT++/src/root2sql.cc
===================================================================
--- /trunk/FACT++/src/root2sql.cc	(revision 19190)
+++ /trunk/FACT++/src/root2sql.cc	(revision 19191)
@@ -65,5 +65,6 @@
         ("conditional",    po_switch(),               "Conditional insert. Only insert if no entry exists yet with the constants defined by --const")
         ("delete",         po_switch(),               "Delete all entries first which fit all constant columns defined by --const")
-        ("index",          po_switch(),               "If a table is created, all const columns are used as a single index")
+        ("index",          po_switch(),               "If a table is created, all const columns are used as a single index (INDEX)")
+        ("unique",         po_switch(),               "If a table is created, all const columns are used as a unqiue index (UNIQUE)")
         ;
 
@@ -205,4 +206,7 @@
         "with the --index option.\n"
         "\n"
+        "To create the index as a UNIQUE INDEX, you can use the --unique option which "
+        "implies --index.\n"
+        "\n"
         "If a query failed, the query is printed to stderr together with the error message. "
         "For the main INSERT query, this is only true if the verbosity level is at least 2 "
@@ -356,4 +360,5 @@
     const bool run_delete        = conf.Get<bool>("delete");
     const bool index             = conf.Get<bool>("index");
+    const bool unique            = conf.Get<bool>("unique");
 
     const string engine          = conf.Get<string>("engine");
@@ -629,6 +634,6 @@
         query += ",\n   PRIMARY KEY USING BTREE (`"+boost::algorithm::join(primary, "`, `")+"`)";
 
-    if (!vindex.empty() && index)
-        query += ",\n   INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)";
+    if (!vindex.empty() && (index || unique))
+        query += ",\n   "+string(unique?"UNIQUE ":"")+"INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)";
 
     query +=
