[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: -minor fixes
From: |
gnunet |
Subject: |
[libeufin] branch master updated: -minor fixes |
Date: |
Thu, 30 Nov 2023 07:18:35 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 9ee3c46e -minor fixes
9ee3c46e is described below
commit 9ee3c46e856c21998b4643a58622daa06da84ee8
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Thu Nov 30 15:18:29 2023 +0900
-minor fixes
---
contrib/libeufin-bank-dbconfig | 7 ++++++-
contrib/libeufin-nexus-dbconfig | 5 +++++
util/src/main/kotlin/DB.kt | 6 ++++--
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/contrib/libeufin-bank-dbconfig b/contrib/libeufin-bank-dbconfig
index 8a685bd8..6da99f66 100755
--- a/contrib/libeufin-bank-dbconfig
+++ b/contrib/libeufin-bank-dbconfig
@@ -99,12 +99,17 @@ then
sudo -i -u postgres dropdb "$DBNAME"
else
echo "Database '$DBNAME' already exists."
- if ! echo "GRANT ALL PRIVILEGES ON $DBNAME TO '$DBUSER'" \
+ if ! echo "GRANT ALL PRIVILEGES ON DATABASE $DBNAME TO \"$DBUSER\"" \
| sudo -i -u postgres psql "$DBNAME"
then
echo "Failed to grant access to database '$DBNAME' to '$DBUSER'."
1>&2
exit 1
fi
+ if ! echo "GRANT ALL PRIVILEGES ON SCHEMA _v TO \"$DBUSER\"" \
+ | sudo -i -u postgres psql "$DBNAME"
+ then
+ echo "Failed to grant access to schema '_v' to '$DBUSER'. Maybe OK
if it does not exist. Will continue." 1>&2
+ fi
fi
else
echo "Creating database $DBNAME." 1>&2
diff --git a/contrib/libeufin-nexus-dbconfig b/contrib/libeufin-nexus-dbconfig
index aa7ad4ee..4ff5472a 100755
--- a/contrib/libeufin-nexus-dbconfig
+++ b/contrib/libeufin-nexus-dbconfig
@@ -104,6 +104,11 @@ then
echo "Failed to grant access to database '$DBNAME' to '$DBUSER'."
1>&2
exit 1
fi
+ if ! echo "GRANT ALL PRIVILEGES ON SCHEMA _v TO \"$DBUSER\"" \
+ | sudo -i -u postgres psql "$DBNAME"
+ then
+ echo "Failed to grant access to schema '_v' to '$DBUSER'. Maybe OK
if it does not exist. Will continue." 1>&2
+ fi
fi
else
echo "Creating database $DBNAME." 1>&2
diff --git a/util/src/main/kotlin/DB.kt b/util/src/main/kotlin/DB.kt
index 53e81fff..830832b6 100644
--- a/util/src/main/kotlin/DB.kt
+++ b/util/src/main/kotlin/DB.kt
@@ -196,9 +196,11 @@ fun initializeDatabaseTables(cfg: DatabaseConfig,
sqlFilePrefix: String) {
logger.info("doing DB initialization, sqldir ${cfg.sqlDir}, dbConnStr
${cfg.dbConnStr}")
pgDataSource(cfg.dbConnStr).pgConnection().use { conn ->
conn.transaction {
+ // FIXME: evil hack, we should instead simply first check if _v
exists!
val sqlVersioning = File("${cfg.sqlDir}/versioning.sql").readText()
- conn.execSQLUpdate(sqlVersioning)
-
+ try {
+ conn.execSQLUpdate(sqlVersioning)
+ } catch (e: SQLException) {}
val checkStmt = conn.prepareStatement("SELECT count(*) as n FROM
_v.patches where patch_name = ?")
for (n in 1..9999) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: -minor fixes,
gnunet <=