invenio/master kwalitee sql fix(one large commit)
Merge branch 'master-sql-fixes' of https://github.com/pamfilos/invenio into master-sql-fixes