Skip to content
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

Switch PostgreSQL container to use pgautoupgrade #250

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

Daniel15
Copy link
Contributor

@Daniel15 Daniel15 commented Jul 7, 2024

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 LemmyNet/lemmy#4892

@ticoombs ticoombs added this to the 1.5.2 milestone Aug 16, 2024
@@ -81,7 +81,7 @@ services:
logging: *default-logging

postgres:
image: docker.io/postgres:16-alpine
image: pgautoupgrade/pgautoupgrade:16-alpine
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind pointing this to the official Docker Hub registry (ex, docker.io/pgautoupgrade/pgautoupgrade) (to avoid any issues with registries.conf, etc)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated.

@ticoombs ticoombs merged commit 5b35eef into LemmyNet:main Aug 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants