MT#58395 new python based ngcp-update-db-schema script

* 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
mr12.2
Kirill Solomko 1 year ago
parent 38e80cca4d
commit b084c5e47a

19
debian/control vendored

@ -7,11 +7,30 @@ Homepage: https://www.sipwise.com/
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
dh-exec,
dh-python,
flake8,
isort,
mypy,
python3-all,
python3-flake8-blind-except,
python3-flake8-builtins,
python3-flake8-class-newline,
python3-flake8-comprehensions,
python3-flake8-docstrings,
python3-flake8-polyfill,
python3-flake8-quotes,
python3-pep8-naming,
python3-pymysql,
python3-setuptools,
python3-typeshed,
Package: ngcp-db-schema
Architecture: all
Depends:
ngcp-system-tools-ce | ngcp-system-tools,
python3-pymysql,
python3-yaml,
${misc:Depends},
Description: database schema for Sipwise's NGCP platform
This package provides the database schema for Sipwise's NGCP

11
debian/rules vendored

@ -4,5 +4,16 @@
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
FLAKE8 := "/usr/bin/flake8"
ISORT := "/usr/bin/isort"
MYPY := "/usr/bin/mypy"
CHK_SCRIPT := "ngcp-update-db-schema"
%:
dh $@
execute_before_dh_auto_test:
$(FLAKE8) $(CHK_SCRIPT)
$(ISORT) --check $(CHK_SCRIPT)
$(MYPY) $(CHK_SCRIPT)

File diff suppressed because it is too large Load Diff

@ -0,0 +1,39 @@
[metadata]
name = ngcp-update-db-schema
version = 2.0
home_page = https://www.sipwise.com
project_urls =
GitHub: issues = https://github.com/sipwise/db-schema/issues
GitHub: repo = https://github.com/sipwise/db-schema
description = NGCP database schema versioning tool
long_description = file: README.md
long_description_content_type = text/markdown
author = Sipwise Development Team <support@sipwise.com>
author_email = support@sipwise.com
license = GPL
license_files = LICENSE.txt
platform = Debian/Linux
[options]
python_requires = >=3.9
[flake8]
exclude =
.git
.env
__pycache__
.eggs
tools
max-line-length = 79
docstring-convention = google
extend-ignore =
# unused import
F401,
# missing docstring in public module
D100,
# missing docstring in public package
D104,
[mypy]
ignore_missing_imports = True
strict = True
Loading…
Cancel
Save