forked from hans/Nominatim
Added --no-superuser flag
To allow import into already existing databases. Refs: #2719
This commit is contained in:
committed by
Sarah Hoffmann
parent
3c32c0354a
commit
ba5ec80611
@@ -87,6 +87,7 @@ class NominatimArgs:
|
||||
offline: bool
|
||||
ignore_errors: bool
|
||||
index_noanalyse: bool
|
||||
no_superuser: bool
|
||||
|
||||
# Arguments to 'index'
|
||||
boundaries_only: bool
|
||||
|
||||
@@ -65,6 +65,8 @@ class SetupAll:
|
||||
help='Continue import even when errors in SQL are present')
|
||||
group3.add_argument('--index-noanalyse', action='store_true',
|
||||
help='Do not perform analyse operations during index (expert only)')
|
||||
group3.add_argument('--no-superuser', action='store_true',
|
||||
help='Do not attempt to create the database')
|
||||
|
||||
|
||||
def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements
|
||||
@@ -81,9 +83,10 @@ class SetupAll:
|
||||
if not files:
|
||||
raise UsageError("No input files (use --osm-file).")
|
||||
|
||||
LOG.warning('Creating database')
|
||||
database_import.setup_database_skeleton(args.config.get_libpq_dsn(),
|
||||
rouser=args.config.DATABASE_WEBUSER)
|
||||
if not args.no_superuser:
|
||||
LOG.warning('Creating database')
|
||||
database_import.setup_database_skeleton(args.config.get_libpq_dsn(),
|
||||
rouser=args.config.DATABASE_WEBUSER)
|
||||
|
||||
LOG.warning('Setting up country tables')
|
||||
country_info.setup_country_tables(args.config.get_libpq_dsn(),
|
||||
|
||||
Reference in New Issue
Block a user