mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add role to psql scripts
This commit is contained in:
parent
8d5f941829
commit
c5001f3620
9 changed files with 25 additions and 25 deletions
|
@ -101,7 +101,7 @@ $ exit
|
|||
$ sudo systemctl enable postgresql
|
||||
$ sudo systemctl start postgresql
|
||||
$ sudo -i -u postgres
|
||||
$ psql -c "CREATE USER kemal WITH PASSWORD 'kemal';"
|
||||
$ psql -c "CREATE USER kemal WITH PASSWORD 'kemal';" # Change 'kemal' here to a stronger password, and update `password` in config/config.yml
|
||||
$ createdb -O kemal invidious
|
||||
$ psql invidious < /home/invidious/invidious/config/sql/channels.sql
|
||||
$ psql invidious < /home/invidious/invidious/config/sql/videos.sql
|
||||
|
@ -143,8 +143,8 @@ $ brew install shards crystal-lang postgres imagemagick librsvg
|
|||
$ git clone https://github.com/omarroth/invidious
|
||||
$ cd invidious
|
||||
$ brew services start postgresql
|
||||
$ psql -c "CREATE ROLE kemal WITH LOGIN PASSWORD 'kemal';"
|
||||
$ createdb invidious -U kemal
|
||||
$ psql -c "CREATE ROLE kemal WITH PASSWORD 'kemal';" # Change 'kemal' here to a stronger password, and update `password` in config/config.yml
|
||||
$ createdb -O kemal invidious
|
||||
$ psql invidious < config/sql/channels.sql
|
||||
$ psql invidious < config/sql/videos.sql
|
||||
$ psql invidious < config/sql/channel_videos.sql
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channels ADD COLUMN subscribed bool;"
|
||||
psql invidious -c "UPDATE channels SET subscribed = false;"
|
||||
psql invidious kemal -c "ALTER TABLE channels ADD COLUMN subscribed bool;"
|
||||
psql invidious kemal -c "UPDATE channels SET subscribed = false;"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE"
|
||||
psql invidious -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE"
|
||||
|
||||
psql invidious -c "ALTER TABLE channel_videos ADD COLUMN live_now bool"
|
||||
psql invidious -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channels ADD COLUMN deleted bool;"
|
||||
psql invidious -c "UPDATE channels SET deleted = false;"
|
||||
psql invidious kemal -c "ALTER TABLE channels ADD COLUMN deleted bool;"
|
||||
psql invidious kemal -c "UPDATE channels SET deleted = false;"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious < config/sql/session_ids.sql
|
||||
psql invidious -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING"
|
||||
psql invidious -c "ALTER TABLE users DROP COLUMN id"
|
||||
psql invidious kemal -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING"
|
||||
psql invidious kemal -c "ALTER TABLE users DROP COLUMN id"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;"
|
||||
psql invidious -c "UPDATE channel_videos SET live_now = false;"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;"
|
||||
psql invidious kemal -c "UPDATE channel_videos SET live_now = false;"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;"
|
||||
psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
psql invidious -c "ALTER TABLE channels DROP COLUMN subscribed"
|
||||
psql invidious -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz"
|
||||
psql invidious -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'"
|
||||
psql invidious kemal -c "ALTER TABLE channels DROP COLUMN subscribed"
|
||||
psql invidious kemal -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz"
|
||||
psql invidious kemal -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'"
|
||||
|
|
|
@ -12,12 +12,12 @@ if [ ! -f /var/lib/postgresql/data/setupFinished ]; then
|
|||
>&2 echo "### importing table schemas"
|
||||
su postgres -c 'createdb invidious'
|
||||
su postgres -c 'psql -c "CREATE USER kemal WITH PASSWORD '"'kemal'"'"'
|
||||
su postgres -c 'psql invidious < config/sql/channels.sql'
|
||||
su postgres -c 'psql invidious < config/sql/videos.sql'
|
||||
su postgres -c 'psql invidious < config/sql/channel_videos.sql'
|
||||
su postgres -c 'psql invidious < config/sql/users.sql'
|
||||
su postgres -c 'psql invidious < config/sql/session_ids.sql'
|
||||
su postgres -c 'psql invidious < config/sql/nonces.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/channels.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/videos.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/channel_videos.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/users.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/session_ids.sql'
|
||||
su postgres -c 'psql invidious kemal < config/sql/nonces.sql'
|
||||
touch /var/lib/postgresql/data/setupFinished
|
||||
echo "### invidious database setup finished"
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue