Add PostgreSQL auto-install and auto-upgrade support#106
Open
guillaume86 wants to merge 2 commits into
Open
Conversation
Enable DOLI_INSTALL_AUTO=1 for PostgreSQL by removing the pgsql exclusion in docker-run.sh and adding pgsql branches for all MySQL-specific operations (DB wait, existence check, version query, init, migration, backup/restore, custom scripts). PostgreSQL initialization reuses the existing PHP install scripts (step2.php/step5.php) which handle MySQL-to-PostgreSQL SQL conversion transparently via the pgsql driver. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
For your information I didn't vibe code this, I actively guided claude across steps and tried to enforce good practices ;). |
|
This needs to be merged ASAP, as I am seeking to use that. Kudos for the efforts @guillaume86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DOLI_INSTALL_AUTO=1for PostgreSQL by removing the pgsql exclusion indocker-run.shstep2.php/step5.php) which handle MySQL-to-PostgreSQL SQL conversion transparently via the pgsql driver'sconvertSQLFromMysql()methodexamples/with-pgsql/docker-compose.ymlwithPOSTGRES_DBandDOLI_URL_ROOTPostgreSQL limitations
DOLI_INIT_DEMO=1is not supported with PostgreSQL (demo dump is MySQL format). A warning is logged and the setting is skipped..sqlfiles indocker-init.d/orbefore-starting.d/must be written in PostgreSQL-compatible SQL (no automatic conversion).Test plan
docker compose(PostgreSQL 15 & 16)MAIN_VERSION_LAST_INSTALLset,install.lockcreatedinstall.lock+ existing DB)pg_dumpbackup created, PHP upgrade scripts executed, DB correctly restored on failureNote on upgrade test: The PHP migration scripts encountered SQL syntax errors from the upstream
22.0.0-23.0.0.sqlmigration file — this is a known upstream issue (Dolibarr/dolibarr#37425), not related to this PR. Our entrypoint code correctly detected the failure and restored the database from thepg_dumpbackup.🤖 Generated with Claude Code