Support PostgreSQL; add CI - #13
Merged
Merged
Conversation
- Token unblock: compute the token expiry cutoff in PHP instead of the MySQL-only DATE_ADD(..., INTERVAL n DAY), which made the unblock link in the notification email fail on PostgreSQL - Warning about an existing "admin" user: compare case-insensitively, as MySQL's collations did, so it also triggers on PostgreSQL for "Admin" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsFEnqepXD2eL6yLVZmSB9
- BlockTable/AllowTable: a new entry comes with an empty id from the edit form, which PostgreSQL rejects as NULL for the id column (MySQL turns it into the next auto-increment value); check() now turns it into 0, which Joomla leaves out of the INSERT on both (codeling/bfstop#206). Found by the new integration tests. - CI workflow: PHP syntax check, and the integration tests from the plugin repository (which cover the component too) on Joomla 5.4/6.1 with MySQL, MariaDB and PostgreSQL Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsFEnqepXD2eL6yLVZmSB9
v4 runs on the deprecated Node.js 20 runtime, which GitHub warned about; v7 runs on Node.js 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsFEnqepXD2eL6yLVZmSB9
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.
Component part of PostgreSQL support for codeling/bfstop#206. The main change, and the test suite, are in codeling/bfstop#227 (same branch name).
Changes
TokenunblockModel): the pruning of old tokens used the MySQL-onlyDATE_ADD(crdate, INTERVAL 3 DAY). On PostgreSQL that aborted the whole unblock, so the unblock link in the notification email never worked. The cutoff is now computed in PHP.DisplayController): now compares withLOWER(u.username), so it also appears for "Admin" on PostgreSQL, as it already did on MySQL.BlockTable,AllowTable): the edit form submits an emptyidfor a new entry. MySQL turns that into the next auto-increment value, but PostgreSQL rejects it asNULLfor the id column, so every save from the backend failed.check(), which the admin model calls before storing, now turns an empty id into 0, which Joomla leaves out of theINSERTon both databases. The new integration tests found this..github/workflows/ci.yml):main.Testing
The plugin repository's test suite was run with this branch as
COM_BFSTOP_ROOTon Joomla 5.4.8 and 6.1.3, each on PostgreSQL and MariaDB: 23 tests pass everywhere. With the component code from before this PR, the three component tests fail on PostgreSQL:null value in column "id")This workflow's integration job was also run locally by extracting its
run:steps fromci.yml, against apostgres:12container; it passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01LsFEnqepXD2eL6yLVZmSB9