[c-c db-check] having no owner is allowed, don't try to fix that stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 22 Jul 2011 08:34:03 +0200
branchstable
changeset 7684 9f8f8096d64b
parent 7683 a21e24831ae4
child 7685 902909e5f733
[c-c db-check] having no owner is allowed, don't try to fix that
server/checkintegrity.py
--- a/server/checkintegrity.py	Thu Jul 21 14:21:14 2011 +0200
+++ b/server/checkintegrity.py	Fri Jul 22 08:34:03 2011 +0200
@@ -333,22 +333,6 @@
                                        % (table, column, eidcolumn, eid),
                                        {'v': default})
                 notify_fixed(fix)
-    cursor = session.system_sql('SELECT MIN(%s) FROM %sCWUser;' % (eidcolumn,
-                                                                  SQL_PREFIX))
-    default_user_eid = cursor.fetchone()[0]
-    assert default_user_eid is not None, 'no user defined !'
-    for rel, default in ( ('owned_by', default_user_eid), ):
-        cursor = session.system_sql("SELECT eid, type FROM entities "
-                                    "WHERE source='system' AND NOT EXISTS "
-                                    "(SELECT 1 FROM %s_relation WHERE eid_from=eid);"
-                                    % rel)
-        for eid, etype in cursor.fetchall():
-            msg = '  %s with eid %s has no %s relation'
-            print >> sys.stderr, msg % (etype, eid, rel),
-            if fix:
-                session.system_sql('INSERT INTO %s_relation VALUES (%s, %s) ;'
-                                   % (rel, eid, default))
-            notify_fixed(fix)
 
 
 def check(repo, cnx, checks, reindex, fix, withpb=True):