-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Variable postgres username and database name in migration scripts #2451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE channels ADD COLUMN subscribed bool;" | ||
| psql invidious kemal -c "UPDATE channels SET subscribed = false;" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN subscribed bool;" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET subscribed = false;" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| #!/bin/sh | ||
|
|
||
| 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" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| 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" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE" | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,22 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN title CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN views CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN likes CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN dislikes CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN wilson_score CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN published CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN description CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN language CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN author CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN ucid CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN allowed_regions CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN is_family_friendly CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN genre CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN genre_url CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN license CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN sub_count_text CASCADE" | ||
| psql invidious kemal -c "ALTER TABLE videos DROP COLUMN author_thumbnail CASCADE" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN title CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN views CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN likes CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN dislikes CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN wilson_score CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN published CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN description CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN language CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN author CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN ucid CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN allowed_regions CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN is_family_friendly CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN genre CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN genre_url CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN license CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN sub_count_text CASCADE" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE videos DROP COLUMN author_thumbnail CASCADE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE channels ADD COLUMN deleted bool;" | ||
| psql invidious kemal -c "UPDATE channels SET deleted = false;" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN deleted bool;" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET deleted = false;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal < config/sql/session_ids.sql | ||
| 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" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" < config/sql/session_ids.sql | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "INSERT INTO session_ids (SELECT unnest(id), email, CURRENT_TIMESTAMP FROM users) ON CONFLICT (id) DO NOTHING" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE users DROP COLUMN id" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal < config/sql/annotations.sql | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" < config/sql/annotations.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN views bigint;" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN views bigint;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" | ||
| psql invidious kemal -c "UPDATE channel_videos SET live_now = false;" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channel_videos SET live_now = false;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE users ADD COLUMN feed_needs_update boolean" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE users ADD COLUMN feed_needs_update boolean" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| #!/bin/sh | ||
|
|
||
| psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| #!/bin/sh | ||
|
|
||
| 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'" | ||
| [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal | ||
| [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious | ||
|
|
||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels DROP COLUMN subscribed" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz" | ||
| psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.