agent/php
Snider 4e190dc7ec fix(brain): Postgres portability for brain connection + migrations
Three related fixes so the brain DB works on Postgres, not just MariaDB:

1. config.php — brain charset/collation was hardcoded to utf8mb4 which
   Postgres rejects as client_encoding. Now driver-aware: utf8 for
   pgsql, utf8mb4 otherwise. Override via BRAIN_DB_CHARSET env var.

2. Migration 000008 (create_brain_memories) — self-referential FK on
   supersedes_id was declared inside Schema::create{}, causing Postgres
   to evaluate it before the PK index existed ('no unique constraint
   matching given keys'). Split into Schema::create + separate
   Schema::table to guarantee PK is in place when FK is added.

3. Migration 000009 (drop workspace FK) — try/catch inside the Blueprint
   closure couldn't catch deferred SQL failures. Replaced with a
   constraint-exists pre-query against information_schema, supporting
   both pgsql and mariadb/mysql drivers. Fresh installs no longer fail
   trying to drop a constraint that was never created.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-23 12:32:58 +01:00
..
Actions revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Configs revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Console/Commands revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Controllers revert fcb9c189e5 2026-04-23 12:32:57 +01:00
docs revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Facades revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Jobs revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Lang/en_GB revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Mcp revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Middleware revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Migrations fix(brain): Postgres portability for brain connection + migrations 2026-04-23 12:32:58 +01:00
Models revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Routes revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Service revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Services revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Support revert fcb9c189e5 2026-04-23 12:32:57 +01:00
tests revert fcb9c189e5 2026-04-23 12:32:57 +01:00
View revert fcb9c189e5 2026-04-23 12:32:57 +01:00
.DS_Store revert fcb9c189e5 2026-04-23 12:32:57 +01:00
agentic.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AGENTS.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Boot.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
config.php fix(brain): Postgres portability for brain connection + migrations 2026-04-23 12:32:58 +01:00
FINDINGS.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
GEMINI.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00
TODO.md revert fcb9c189e5 2026-04-23 12:32:57 +01:00