X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/810056349f0dde9e0ddeb6655cbf1aa48399b3a5..9f64c34f1a579cca7aa144365e5519fce9e47391:/nominatim/tools/migration.py diff --git a/nominatim/tools/migration.py b/nominatim/tools/migration.py index 87febacc..94058f33 100644 --- a/nominatim/tools/migration.py +++ b/nominatim/tools/migration.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Functions for database migration to newer software versions. """ @@ -26,7 +32,7 @@ def migrate(config, paths): if db_version_str is not None: parts = db_version_str.split('.') - db_version = tuple([int(x) for x in parts[:2] + parts[2].split('-')]) + db_version = tuple(int(x) for x in parts[:2] + parts[2].split('-')) if db_version == NOMINATIM_VERSION: LOG.warning("Database already at latest version (%s)", db_version_str) @@ -96,6 +102,7 @@ def _migration(major, minor, patch=0, dbpatch=0): """ def decorator(func): _MIGRATION_FUNCTIONS.append(((major, minor, patch, dbpatch), func)) + return func return decorator @@ -195,7 +202,7 @@ def install_legacy_tokenizer(conn, config, **_): @_migration(4, 0, 99, 0) -def create_tiger_housenumber_index(conn, _, **_): +def create_tiger_housenumber_index(conn, **_): """ Create idx_location_property_tiger_parent_place_id with included house number.