[repo, hooks] small task optimization: don't start cleanup_old_transactions when undo support is not activated, and retrieve a session to update a source only when some source to update is found
if not rql('CWConstraintType X WHERE X name "RQLUniqueConstraint"',
ask_confirm=False):
rql('INSERT CWConstraintType X: X name "RQLUniqueConstraint"',
ask_confirm=False)