diff --git a/config/migrate-scripts/migrate-db-1c8075c.sh b/config/migrate-scripts/migrate-db-1c8075c.sh new file mode 100755 index 000000000..92ad1c7bf --- /dev/null +++ b/config/migrate-scripts/migrate-db-1c8075c.sh @@ -0,0 +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 -c "ALTER TABLE channel_videos ADD COLUMN live_now bool" +psql invidious -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz" diff --git a/config/migrate-scripts/migrate-db-3646395.sh b/config/migrate-scripts/migrate-db-3646395.sh new file mode 100755 index 000000000..38a4f665c --- /dev/null +++ b/config/migrate-scripts/migrate-db-3646395.sh @@ -0,0 +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" diff --git a/config/migrate-scripts/migrate-db-3864cbf.sh b/config/migrate-scripts/migrate-db-3864cbf.sh deleted file mode 100755 index c63d37f05..000000000 --- a/config/migrate-scripts/migrate-db-3864cbf.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -psql invidious -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;" diff --git a/config/migrate-scripts/migrate-db-88b7097.sh b/config/migrate-scripts/migrate-db-88b7097.sh index 38a4f665c..c63d37f05 100755 --- a/config/migrate-scripts/migrate-db-88b7097.sh +++ b/config/migrate-scripts/migrate-db-88b7097.sh @@ -1,5 +1,3 @@ #!/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 -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;"