From a1f49b279f3313e9edf3a65f45ce75115c484dab Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 23 Mar 2019 11:28:24 -0500 Subject: [PATCH] Rename migrate scripts --- config/migrate-scripts/migrate-db-1c8075c.sh | 7 +++++++ config/migrate-scripts/migrate-db-3646395.sh | 5 +++++ config/migrate-scripts/migrate-db-3864cbf.sh | 3 --- config/migrate-scripts/migrate-db-88b7097.sh | 4 +--- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100755 config/migrate-scripts/migrate-db-1c8075c.sh create mode 100755 config/migrate-scripts/migrate-db-3646395.sh delete mode 100755 config/migrate-scripts/migrate-db-3864cbf.sh diff --git a/config/migrate-scripts/migrate-db-1c8075c.sh b/config/migrate-scripts/migrate-db-1c8075c.sh new file mode 100755 index 00000000..92ad1c7b --- /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 00000000..38a4f665 --- /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 c63d37f0..00000000 --- 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 38a4f665..c63d37f0 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;"