From 05d341df8946b88eb89a4a4e4ac1125abfe3e55e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 11 Dec 2019 11:38:44 +0300 Subject: [PATCH] add support for restoring schema on restart (needed only for demo, not normally used) --- app/startup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/startup.sh b/app/startup.sh index fe46213..85cd456 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -40,7 +40,11 @@ done $PSQL -c "create extension if not exists pg_trgm" -if ! $PSQL -c 'select * from ttrss_version'; then +RESTORE_SCHEMA=/var/www/html/tt-rss/backups/restore-schema.sql.gz + +if [ -r $RESTORE_SCHEMA ]; then + zcat $RESTORE_SCHEMA | $PSQL +elif ! $PSQL -c 'select * from ttrss_version'; then $PSQL < /var/www/html/tt-rss/schema/ttrss_schema_pgsql.sql fi