creativecommons / legaldb

CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
https://LegalDB.CreativeCommons.org/
MIT License
44 stars 54 forks source link

[Feature] Ensure PostgreSQL is v15 in all locations #166

Closed TimidRobot closed 7 months ago

TimidRobot commented 7 months ago

Problem

  1. Production Heroku PostgreSQL is v12

    PostgreSQL 12 reaches End of Life on 2024-May-30. Due to security and operational concerns, Heroku cannot run unsupported software as a service.

  2. GitHub Actions PostgreSQL is v14
  3. Local dev Docker PostgreSQL is v14

Description

Ensure PostgreSQL is v15 in all locations (both local dev and production Heroku)

Additional context

Implementation

TimidRobot commented 7 months ago

Production upgraded per Upgrading the Version of a Heroku Postgres Database | Heroku Dev Center:

  1. Initialize follower:

    heroku addons:create heroku-postgresql:standard-0 --follow postgresql-sinuous-94712
    • Warning encountered due to heroku/homebrew-brew#37

      Warning: heroku update available from 8.5.0 to 8.10.0.

  2. Track status and wait for completion

    heroku pg:wait
  3. Enable maintenance mode

    heroku maintenance:on
  4. Verify follower is caught up:

    heroku pg:info
  5. Upgrade follower database

    heroku pg:upgrade postgresql-flat-93199
  6. Track status and wait for completion

    heroku pg:wait
  7. Promote new Postgre 15 database

    heroku pg:promote postgresql-flat-93199
  8. Verify promotion:

    heroku pg:info
  9. Disable maintenance

    heroku maintenance:off
  10. Verify app with new database at: https://legaldb.creativecommons.org/

  11. Destroy v12 database

    heroku addons:destroy postgresql-sinuous-94712