Skip to content

Support PostgreSQL; add CI - #13

Merged
codeling merged 4 commits into
mainfrom
claude/busy-knuth-m2ipx0
Sep 30, 2026
Merged

codeling merged 4 commits into
mainfrom
claude/busy-knuth-m2ipx0

Conversation

@codeling

@codeling codeling commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

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

  • Token unblock (TokenunblockModel): the pruning of old tokens used the MySQL-only DATE_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.
  • Warning about an existing "admin" user (DisplayController): now compares with LOWER(u.username), so it also appears for "Admin" on PostgreSQL, as it already did on MySQL.
  • Saving new blocks / allow-list entries (BlockTable, AllowTable): the edit form submits an empty id for a new entry. MySQL turns that into the next auto-increment value, but PostgreSQL rejects it as NULL for 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 the INSERT on both databases. The new integration tests found this.
  • CI (.github/workflows/ci.yml):
    • PHP syntax check on 8.1 and 8.4.
    • The integration tests from the plugin repository, which cover the component too, on Joomla 5.4.8 and 6.1.3 with MySQL, MariaDB and PostgreSQL.
    • The plugin is checked out from its branch of the same name if one exists, otherwise main.

Testing

The plugin repository's test suite was run with this branch as COM_BFSTOP_ROOT on 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:

  • saving a new block (null value in column "id")
  • unblocking via email token
  • the admin-user warning

This workflow's integration job was also run locally by extracting its run: steps from ci.yml, against a postgres:12 container; it passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LsFEnqepXD2eL6yLVZmSB9

- 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
@codeling codeling changed the title Support PostgreSQL Support PostgreSQL; add CI Sep 27, 2026
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
@codeling
codeling merged commit 4156429 into main Sep 30, 2026
6 checks 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.

2 participants