LemmyNet / lemmy-ansible

A docker deploy for ansible
GNU Affero General Public License v3.0
248 stars 92 forks source link

Switch PostgreSQL container to use pgautoupgrade #250

Closed Daniel15 closed 1 month ago

Daniel15 commented 3 months ago

Lemmy changed from PostgreSQL 15 to 16 at some point, and trying to switch from 15 to 16 in docker-compose.yml results in errors like this at startup:

DETAIL: The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16.3

This PR changes the PostgreSQL container to use pgautoupgrade. The pgautoupgrade image is based on the regular PostgreSQL one, but it automatically updates the data to the newer format on startup. This avoids users having to figure it out manually.

Same change as in https://github.com/LemmyNet/lemmy/pull/4892