migrate-db-1c8075c.sh 518 B

1234567891011
  1. #!/bin/sh
  2. [ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal
  3. [ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious
  4. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN live_now CASCADE"
  5. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos DROP COLUMN premiere_timestamp CASCADE"
  6. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool"
  7. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN premiere_timestamp timestamptz"