base: add inveniomanage database diff command

* Adds command to diff database schema against installed
  database models.

NOTE: beware, patch amended by Tibor to use new file names
upgrader: change to module-aware engine

* Changes upgrader to load upgrades from all installed modules.

* Changes upgrade naming convention to be compatible with
  invenio modules.

* Changes upgrader to use SQLAlchemy models for querying
  instead of run_sql.

* Changes recipe creation to use module import paths as input
  instead of system paths.

* Relaxes constraint on cross-graph dependencies to allow
  inter-module dependencies.

* Removes pre-upgrade check for legacy custom templates.

* Adds tests of recipe creation.

* Fixes PEP8 issues.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
requirements: qrcode removal

* qrcode removed from main requirements;

Signed-off-by: Adrian-Tudor Panescu <adrian.tudor.panescu@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
Grunt: typeahead.js fix

Signed-off-by: Adrian-Tudor Panescu <adrian.tudor.panescu@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
restful: fix extension initialization

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
deposit: plupload filetable fix

* Displays uploaded files in deposition form.

Signed-off-by: Adrian-Tudor Panescu <adrian.tudor.panescu@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
upgrader: add auto-generation of upgrades

* Adds auto-generation of upgrades via Alembic.

* Adds dependency on Alembic to perform database schema
  operations.

* Refactors code structure by splitting engine module into
  separate modules.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
upgrader: fix auto-generation of upgrades

* Fixes an issue with wrong upgrades being generated
  due to all SQLAlchemy models not being loaded.

* Adds option to create recipe command to overwrite the
  upgrade file if it already exists, as well as naming it
  from the CLI.

* Fixes an relative import bug in pre/post checks.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>

NOTE: beware, patch amended by Tibor to use new file names
JSONAlchemy: bug fixes and tests improvements

Signed-off-by: Esteban J. G. Gabancho <esteban.gabancho@gmail.com>

NOTE: beware, patch amended by Tibor to use new file names
classifer: fix classifer registry name

* Fixes the name of the classifer registry which accidentially
  was discovered by bibconvert registry due to name clash.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Tested-by: Jiri Kuncar <jiri.kuncar@cern.ch>
BibDocFile: hotfix plugins loading

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
oairepository: automatically compute model field

* Connects OaiREPOSITORY model to SQLAlchemy events to ensure field
  setDefinition is properly computed on db insert/update when using
  the SQLAlchemy model.
oairepository: include restricted records

* Adds configuration variable CFG_OAI_FILTER_RESTRICTED_RECORDS
  to include restricted records in OAI-PMH output. Useful if a
  record is part of both public and restricted collections.
comments: remove unused property

* Removes an unused property on the CmtSUBSCRIPTION model, that also
  caused an initialization error due to the user of current_user
  proxy outside of the Flask application context.

Co-authored-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
formatter: fix for xml record formatting

* Fixes issue in formatting of XML records.
formatter: fix unicode decoding error in rss

* Fixes a unicode decoding issue in the RSS feed.
celery: fix email reporting

* Fixes an issue preventing error emails from being sent.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
access: improve login performance

* Adds argument batch mode in acc_authorize_action to lower number of
  database queries when testing many arguments against the same action
  and user.

* Improves login performance by using the acc_authorize_action
  argument batch mode to calculate list of permitted collections for
  a user.
persistentid: add function to create url

* Adds a function that for a given persistent identifier will
  try to create a URL to a resolver.
persistentid: fix ISSN validation issue

* Fixes an issue where an 8-character non-ISSN string would cause an
  exception.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>