mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 01:47:57 +00:00
pass reverse-only as a separate parameter
... instead of hacking the internal structures of SQLPreprocessor
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS search_name;
|
DROP TABLE IF EXISTS search_name;
|
||||||
|
|
||||||
{% if not db.reverse_only %}
|
{% if not create_reverse_only %}
|
||||||
|
|
||||||
CREATE TABLE search_name (
|
CREATE TABLE search_name (
|
||||||
place_id BIGINT NOT NULL,
|
place_id BIGINT NOT NULL,
|
||||||
|
|||||||
@@ -152,12 +152,11 @@ def create_tables(conn: Connection, config: Configuration, reverse_only: bool =
|
|||||||
When `reverse_only` is True, then the main table for searching will
|
When `reverse_only` is True, then the main table for searching will
|
||||||
be skipped and only reverse search is possible.
|
be skipped and only reverse search is possible.
|
||||||
"""
|
"""
|
||||||
sql = SQLPreprocessor(conn, config)
|
SQLPreprocessor(conn, config).run_sql_file(conn, 'tables.sql',
|
||||||
sql.env.globals['db']['reverse_only'] = reverse_only
|
create_reverse_only=reverse_only)
|
||||||
|
|
||||||
sql.run_sql_file(conn, 'tables.sql')
|
# reinitiate the preprocessor to get all the newly created tables
|
||||||
|
SQLPreprocessor(conn, config).run_sql_file(conn, 'grants.sql')
|
||||||
sql.run_sql_file(conn, 'grants.sql')
|
|
||||||
|
|
||||||
|
|
||||||
def create_table_triggers(conn: Connection, config: Configuration) -> None:
|
def create_table_triggers(conn: Connection, config: Configuration) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user