ttrss: Fix issue with installing after an uninstalling

Tests:

- Without the patch, uninstall and reinstall will fail. With patch it passes.

- Rerunning setup does not destroy the contents of the database.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-01-09 22:48:29 -08:00 committed by James Valleroy
parent b99ead7aa6
commit 9aa3203733
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 7 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class TTRSSApp(app_module.App):
app_id = 'ttrss'
_version = 6
_version = 7
def __init__(self) -> None:
"""Create components for the app."""

View File

@ -77,6 +77,12 @@ def setup():
aug.save()
config = _get_database_config()
# dbconfig may not always setup the database and user account correctly.
# Following, operation to create database/user is an idempotent operation.
postgres.create_database(config['database'], config['user'],
config['password'])
if action_utils.service_is_enabled('tt-rss'):
action_utils.service_restart('tt-rss')