mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
migration - add some documentation on limits regarding the database owner name
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
4750fb228f
commit
8ae4ec52a3
2 changed files with 6 additions and 5 deletions
|
|
@ -91,10 +91,10 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
|
|||
# Get the Owner
|
||||
DB_OWNER="$(grep "$GREP_STRING" "$DUMP_FILE" | grep -oP 'Owner:.*$' | sed 's|Owner:||;s| ||g')"
|
||||
if [ "$DB_OWNER" = "$POSTGRES_USER" ]; then
|
||||
DIFFERENT_DB_OWNER=1
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
ALTER DATABASE "$POSTGRES_DB" OWNER TO "$POSTGRES_USER";
|
||||
EOSQL
|
||||
echo "Unfortunately was the found database owner of the dump file the same as the POSTGRES_USER $POSTGRES_USER"
|
||||
echo "It is not possible to import a database dump from this database owner."
|
||||
echo "However you might rename the owner in the dumpfile to something else."
|
||||
exit 1
|
||||
elif [ "$DB_OWNER" != "oc_$POSTGRES_USER" ]; then
|
||||
DIFFERENT_DB_OWNER=1
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue