mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
apply marker filtering to functions.sql also after table creation
fixes #430
This commit is contained in:
@@ -217,29 +217,7 @@
|
|||||||
echo "Functions\n";
|
echo "Functions\n";
|
||||||
$bDidSomething = true;
|
$bDidSomething = true;
|
||||||
if (!file_exists(CONST_InstallPath.'/module/nominatim.so')) fail("nominatim module not built");
|
if (!file_exists(CONST_InstallPath.'/module/nominatim.so')) fail("nominatim module not built");
|
||||||
$sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
|
create_sql_functions();
|
||||||
$sTemplate = str_replace('{modulepath}', CONST_InstallPath.'/module', $sTemplate);
|
|
||||||
if ($aCMDResult['enable-diff-updates'])
|
|
||||||
{
|
|
||||||
$sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
|
|
||||||
}
|
|
||||||
if ($aCMDResult['enable-debug-statements'])
|
|
||||||
{
|
|
||||||
$sTemplate = str_replace('--DEBUG:', '', $sTemplate);
|
|
||||||
}
|
|
||||||
if (CONST_Limit_Reindexing)
|
|
||||||
{
|
|
||||||
$sTemplate = str_replace('--LIMIT INDEXING:', '', $sTemplate);
|
|
||||||
}
|
|
||||||
if (!CONST_Use_US_Tiger_Data)
|
|
||||||
{
|
|
||||||
$sTemplate = str_replace('-- %NOTIGERDATA% ', '', $sTemplate);
|
|
||||||
}
|
|
||||||
if (!CONST_Use_Aux_Location_data)
|
|
||||||
{
|
|
||||||
$sTemplate = str_replace('-- %NOAUXDATA% ', '', $sTemplate);
|
|
||||||
}
|
|
||||||
pgsqlRunScript($sTemplate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($aCMDResult['create-tables'] || $aCMDResult['all'])
|
if ($aCMDResult['create-tables'] || $aCMDResult['all'])
|
||||||
@@ -265,10 +243,7 @@
|
|||||||
|
|
||||||
// re-run the functions
|
// re-run the functions
|
||||||
echo "Functions\n";
|
echo "Functions\n";
|
||||||
$sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
|
create_sql_functions();
|
||||||
$sTemplate = str_replace('{modulepath}',
|
|
||||||
CONST_InstallPath.'/module', $sTemplate);
|
|
||||||
pgsqlRunScript($sTemplate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($aCMDResult['create-partition-tables'] || $aCMDResult['all'])
|
if ($aCMDResult['create-partition-tables'] || $aCMDResult['all'])
|
||||||
@@ -943,3 +918,31 @@
|
|||||||
return $sSql;
|
return $sSql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_sql_functions()
|
||||||
|
{
|
||||||
|
$sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
|
||||||
|
$sTemplate = str_replace('{modulepath}', CONST_InstallPath.'/module', $sTemplate);
|
||||||
|
if ($aCMDResult['enable-diff-updates'])
|
||||||
|
{
|
||||||
|
$sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
|
||||||
|
}
|
||||||
|
if ($aCMDResult['enable-debug-statements'])
|
||||||
|
{
|
||||||
|
$sTemplate = str_replace('--DEBUG:', '', $sTemplate);
|
||||||
|
}
|
||||||
|
if (CONST_Limit_Reindexing)
|
||||||
|
{
|
||||||
|
$sTemplate = str_replace('--LIMIT INDEXING:', '', $sTemplate);
|
||||||
|
}
|
||||||
|
if (!CONST_Use_US_Tiger_Data)
|
||||||
|
{
|
||||||
|
$sTemplate = str_replace('-- %NOTIGERDATA% ', '', $sTemplate);
|
||||||
|
}
|
||||||
|
if (!CONST_Use_Aux_Location_data)
|
||||||
|
{
|
||||||
|
$sTemplate = str_replace('-- %NOAUXDATA% ', '', $sTemplate);
|
||||||
|
}
|
||||||
|
pgsqlRunScript($sTemplate);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user