summaryrefslogtreecommitdiff
path: root/sources/potlatch
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-13 21:31:39 +0100
committerJochen Topf <jochen@topf.org>2010-11-13 21:31:39 +0100
commit9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d (patch)
tree0d2ae6de413c39c21d30aaf296a98ee37977ab45 /sources/potlatch
parentc82bbe69572398d44187ca7b57b1ce572f435d65 (diff)
downloadtaginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar
taginfo-9db63dc2526bf0b2a94e7a6f37a0f7dabdb8f12d.tar.gz
Multiple changes
* Improved and cleaned up source import scripts * Improved some reports and report overview * New osmium version that uses a better hash function * Some experimental magic to include Javascipt in an easier way (tested in keys.erb)
Diffstat (limited to 'sources/potlatch')
-rw-r--r--sources/potlatch/post.sql2
-rw-r--r--sources/potlatch/pre.sql19
-rwxr-xr-xsources/potlatch/update.sh17
3 files changed, 14 insertions, 24 deletions
diff --git a/sources/potlatch/post.sql b/sources/potlatch/post.sql
index 3446d08..1254b89 100644
--- a/sources/potlatch/post.sql
+++ b/sources/potlatch/post.sql
@@ -11,3 +11,5 @@ UPDATE features SET category_name = (SELECT name FROM categories WHERE id=catego
ANALYZE;
+UPDATE source SET update_end=datetime('now');
+
diff --git a/sources/potlatch/pre.sql b/sources/potlatch/pre.sql
index 9f79445..35d8c9d 100644
--- a/sources/potlatch/pre.sql
+++ b/sources/potlatch/pre.sql
@@ -6,24 +6,7 @@
.bail ON
-DROP TABLE IF EXISTS meta;
-
-CREATE TABLE meta (
- source_id TEXT,
- source_name TEXT,
- update_start TEXT,
- update_end TEXT,
- data_until TEXT
-);
-
-INSERT INTO meta (source_id, source_name, update_start, data_until) SELECT 'potlatch', 'Potlatch', datetime('now'), datetime('now');
-
-DROP TABLE IF EXISTS stats;
-
-CREATE TABLE stats (
- key TEXT,
- value INT64
-);
+INSERT INTO source (id, name, update_start, data_until) SELECT 'potlatch', 'Potlatch', datetime('now'), datetime('now');
--
-- categories
diff --git a/sources/potlatch/update.sh b/sources/potlatch/update.sh
index 8ba9956..748ff4a 100755
--- a/sources/potlatch/update.sh
+++ b/sources/potlatch/update.sh
@@ -9,32 +9,37 @@ set -e
DIR=$1
+DATECMD='date +%Y-%m-%dT%H:%M:%S'
+
if [ "x" = "x$DIR" ]; then
echo "Usage: update.sh DIR"
exit 1
fi
-echo -n "Start potlatch: "; date
+echo "`$DATECMD` Start potlatch..."
DATABASE=$DIR/taginfo-potlatch.db
rm -f $DATABASE
-echo "Getting resources..."
+echo "`$DATECMD` Updating resources..."
if [ -d $DIR/resources ]; then
svn update $DIR/resources
else
svn checkout http://svn.openstreetmap.org/applications/editors/potlatch2/resources $DIR/resources
fi
-echo "Running pre.sql..."
+echo "`$DATECMD` Running init.sql..."
+sqlite3 $DATABASE <../init.sql
+
+echo "`$DATECMD` Running pre.sql..."
sqlite3 $DATABASE <pre.sql
-echo "Running import..."
+echo "`$DATECMD` Running import..."
./import_potlatch.rb $DIR
-echo "Running post.sql..."
+echo "`$DATECMD` Running post.sql..."
sqlite3 $DATABASE <post.sql
-echo -n "Done potlatch: "; date
+echo "`$DATECMD` Done potlatch."