alternate db initialization

This commit is contained in:
chmistry 2024-08-27 23:04:18 +02:00
parent 893e73f2bf
commit f3fcf89cc3

View file

@ -28,26 +28,25 @@ msg_ok "Installed Dependencies"
msg_info "Installing Postgresql and pgvector" msg_info "Installing Postgresql and pgvector"
$STD /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y $STD /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
apt install -y postgresql postgresql-16-pgvector $STD apt install -y postgresql postgresql-16-pgvector
msg_ok "Installed Postgresql and pgvector" msg_ok "Installed Postgresql and pgvector"
msg_info "Setting up database" msg_info "Setting up database"
#test this: #test this:
$STD su postgres -s /bin/sh -c "psql \ #$STD su postgres -s /bin/sh -c "psql \
CREATE DATABASE immich; #CREATE DATABASE immich;
CREATE USER immich WITH ENCRYPTED PASSWORD 'YUaaWZAvtL@JpNgpi3z6uL4MmDMR_w'; #CREATE USER immich WITH ENCRYPTED PASSWORD 'YUaaWZAvtL@JpNgpi3z6uL4MmDMR_w';
GRANT ALL PRIVILEGES ON DATABASE immich to immich; #GRANT ALL PRIVILEGES ON DATABASE immich to immich;
ALTER USER immich WITH SUPERUSER; #ALTER USER immich WITH SUPERUSER;
\q" #\q"
#otherwise this: #otherwise this:
#su postgres <<EOF su postgres <<EOF
#psql -c "CREATE DATABASE immich;" psql -c "CREATE DATABASE immich;"
#psql -c "CREATE USER immich WITH ENCRYPTED PASSWORD 'YUaaWZAvtL@JpNgpi3z6uL4MmDMR_w';" psql -c "CREATE USER immich WITH ENCRYPTED PASSWORD 'YUaaWZAvtL@JpNgpi3z6uL4MmDMR_w';"
#psql -c "GRANT ALL PRIVILEGES ON DATABASE immich to immich;" psql -c "GRANT ALL PRIVILEGES ON DATABASE immich to immich;"
#psql -c "ALTER USER immich WITH SUPERUSER;" psql -c "ALTER USER immich WITH SUPERUSER;"
#EOF EOF
msg_ok "Database setup completed" msg_ok "Database setup completed"
msg_info "Installing ffmpeg yellyfin" msg_info "Installing ffmpeg yellyfin"