* ngcp-update-db-schema is rewritten in python. that simplifies
the code, as well as enables flexibility and more complex features
support, as well as performance improvements
* full strict mypy compliant
* flake8 compliant
* google docstring complied
* add .down scripts support
* add docstring full documentation
* add mypy, isort, flake8 checks during build phase
* add command line arguments that support --to-revision, to stop
.up/.down scripts execution when it reaches a certain revision
* better support for ngcp-sync-db
* preserve AUTOMATED_INSTALL_MODE and SKIP_SYNC_DB env vars support
for backward compatibility, in the future it is recommented to
switch to the existing (--automated, --skip-ro-sync-db) options
* experimental batch mode support where instead of applying changes
one by one, they are accumulated into a file along with db_schema
revision tracking changes and applied at once
Change-Id: I4632393d52d1a60c945b4d87a779f1a073ed9a5f
The main tool ngcp-build-schema-files:
1. initializes and starts a dedicated mysql instance in tmpfs.
2. prepares schemes.
3. runs ngcp-dump-json.pl and mysqldump to get sql and json files.
4. stops and deletes mysql instance.
The helper ngcp-dump-json.pl creates json dump of the schema.
Change-Id: I65968d0f9136b619f9adc5ed735daca0bd129e6e
For a long time our installation and upgrade uses a temporary "policy-rc.d" to
prevent to [re]start services in the middle of the installation, so some uses of
"invoke-rc.d" (which defers to "policy-rc.d") can cause changes in behaviour.
Upon review because of this change, we found out that the restart of kamailio
when updating ngcp-db-schema didn't happen for a long time because of the use of
"policy-rc.d" that we were using during installations of upgrades in the last
few months/years, but besides this, the code is obsolete since quite a while
ago.
So we drop it completely now.
Change-Id: I76eae2fbda340a1021f10d28f95e76b35ea92c90