[core schema] CWSourceHostConfig.match_host only unique per source
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 25 Oct 2010 15:31:29 +0200
changeset 6622 27402fe6a94a
parent 6621 11c09415078b
child 6623 4cb6d319d16d
[core schema] CWSourceHostConfig.match_host only unique per source
misc/migration/3.10.5_Any.py
schemas/base.py
--- a/misc/migration/3.10.5_Any.py	Mon Oct 25 15:30:50 2010 +0200
+++ b/misc/migration/3.10.5_Any.py	Mon Oct 25 15:31:29 2010 +0200
@@ -1,3 +1,4 @@
+sync_schema_props_perms('CWSourceHostConfig', syncperms=False)
 
 sql('INSERT INTO cw_source_relation(eid_from, eid_to) '
     'SELECT e.eid,s.cw_eid FROM entities as e, cw_CWSource as s '
--- a/schemas/base.py	Mon Oct 25 15:30:50 2010 +0200
+++ b/schemas/base.py	Mon Oct 25 15:31:29 2010 +0200
@@ -261,7 +261,8 @@
         'update': ('managers',),
         'delete': ('managers',),
         }
-    match_host = String(required=True, unique=True, maxsize=128,
+    __unique_together__ = [('match_host', 'cw_host_config_of')]
+    match_host = String(required=True, maxsize=128,
                         description=_('regexp matching host(s) to which this config applies'))
     config = String(required=True,
                     description=_('Source\'s configuration for a particular host. '