docker,kubernetes: create PostgreSQL "privacy" type before using it

Fixes the following error when setting up the database:

    postgres_1   | 2020-02-21 01:01:22.371 UTC [172] ERROR:  type "privacy" does not exist at character 200
    postgres_1   | 2020-02-21 01:01:22.371 UTC [172] STATEMENT:  CREATE TABLE public.playlists
    postgres_1   | 	(
    postgres_1   | 	    title text,
    postgres_1   | 	    id text primary key,
    postgres_1   | 	    author text,
    postgres_1   | 	    description text,
    postgres_1   | 	    video_count integer,
    postgres_1   | 	    created timestamptz,
    postgres_1   | 	    updated timestamptz,
    postgres_1   | 	    privacy privacy,
    postgres_1   | 	    index int8[]
    postgres_1   | 	);
    postgres_1   | ERROR:  type "privacy" does not exist
    postgres_1   | LINE 10:     privacy privacy,
This commit is contained in:
Leon Klingele 2020-02-21 02:15:24 +01:00
parent 957b34adbd
commit 6ac4813594
No known key found for this signature in database
GPG Key ID: 0C8AF48831EEC211
2 changed files with 3 additions and 3 deletions

View File

@ -19,9 +19,9 @@ if [ ! -f /var/lib/postgresql/data/setupFinished ]; then
su postgres -c 'psql invidious kemal < config/sql/session_ids.sql' su postgres -c 'psql invidious kemal < config/sql/session_ids.sql'
su postgres -c 'psql invidious kemal < config/sql/nonces.sql' su postgres -c 'psql invidious kemal < config/sql/nonces.sql'
su postgres -c 'psql invidious kemal < config/sql/annotations.sql' su postgres -c 'psql invidious kemal < config/sql/annotations.sql'
su postgres -c 'psql invidious kemal < config/sql/privacy.sql'
su postgres -c 'psql invidious kemal < config/sql/playlists.sql' su postgres -c 'psql invidious kemal < config/sql/playlists.sql'
su postgres -c 'psql invidious kemal < config/sql/playlist_videos.sql' su postgres -c 'psql invidious kemal < config/sql/playlist_videos.sql'
su postgres -c 'psql invidious kemal < config/sql/privacy.sql'
touch /var/lib/postgresql/data/setupFinished touch /var/lib/postgresql/data/setupFinished
echo "### invidious database setup finished" echo "### invidious database setup finished"
exit exit

View File

@ -17,9 +17,9 @@ $ kubectl create configmap invidious-postgresql-init \
--from-file=../config/sql/session_ids.sql \ --from-file=../config/sql/session_ids.sql \
--from-file=../config/sql/nonces.sql \ --from-file=../config/sql/nonces.sql \
--from-file=../config/sql/annotations.sql \ --from-file=../config/sql/annotations.sql \
--from-file=../config/sql/privacy.sql \
--from-file=../config/sql/playlists.sql \ --from-file=../config/sql/playlists.sql \
--from-file=../config/sql/playlist_videos.sql \ --from-file=../config/sql/playlist_videos.sql
--from-file=../config/sql/privacy.sql
# Install Helm app to your Kubernetes cluster # Install Helm app to your Kubernetes cluster
$ helm install invidious ./ $ helm install invidious ./