migrate-db-8e884fe.sh 389 B

123456789
  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 channels DROP COLUMN subscribed"
  5. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channels ADD COLUMN subscribed timestamptz"
  6. psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channels SET subscribed = '2019-01-01 00:00:00+00'"