drop a note about usage of sqls_create_multicol_unique_index and avoid a lgdb warning
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 03 Feb 2016 11:12:58 +0100
changeset 11087 35b29f1eb37a
parent 11086 c9641ee0b652
child 11095 02e88ca3bc23
drop a note about usage of sqls_create_multicol_unique_index and avoid a lgdb warning
cubicweb/server/sources/native.py
--- a/cubicweb/server/sources/native.py	Thu Jan 21 16:08:17 2016 +0100
+++ b/cubicweb/server/sources/native.py	Wed Feb 03 11:12:58 2016 +0100
@@ -1457,7 +1457,9 @@
     DELETE FROM tx_relation_actions WHERE tx_uuid=OLD.tx_uuid;
 END;;
 '''
-    schema += ';;'.join(helper.sqls_create_multicol_unique_index('entities', ['extid']))
+    # define a multi-columns index on a single index to please sqlserver, which doesn't like several
+    # null entries in a UNIQUE column
+    schema += ';;'.join(helper.sqls_create_multicol_unique_index('entities', ['extid'], 'entities_extid_idx'))
     schema += ';;\n'
     return schema