X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/83d2c440d51d3e1e29b51397b5a6c82856e285af..98432395c31f0ae46962907e2c19c4eebc12c8bb:/nominatim/tools/migration.py?ds=sidebyside diff --git a/nominatim/tools/migration.py b/nominatim/tools/migration.py index c24b09cb..dc6dfeca 100644 --- a/nominatim/tools/migration.py +++ b/nominatim/tools/migration.py @@ -231,7 +231,7 @@ def create_interpolation_index_on_place(conn, **_): @_migration(4, 0, 99, 2) def add_step_column_for_interpolation(conn, **_): - """ Add a new column 'step' to the interpolations table which will. + """ Add a new column 'step' to the interpolations table. Also convers the data into the stricter format which requires that startnumbers comply with the odd/even requirements. @@ -259,3 +259,15 @@ def add_step_column_for_interpolation(conn, **_): SET step = CASE WHEN interpolationtype = 'all' THEN 1 ELSE 2 END """) + + +@_migration(4, 0, 99, 3) +def add_step_column_for_tiger(conn, **_): + """ Add a new column 'step' to the tiger data table. + """ + with conn.cursor() as cur: + cur.execute("ALTER TABLE location_property_tiger ADD COLUMN step SMALLINT") + cur.execute("""UPDATE location_property_tiger + SET step = CASE WHEN interpolationtype = 'all' + THEN 1 ELSE 2 END + """)