agent/php/Migrations
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
..
0001_01_01_000001_create_agentic_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000002_add_ip_whitelist_to_agent_api_keys.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000003_create_agent_plans_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000004_create_prompt_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000005_add_performance_indexes.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000006_add_soft_deletes_to_agent_plans.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000007_add_template_versions.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000008_create_brain_memories_table.php fix(brain): Postgres portability for brain connection + migrations 2026-04-23 12:32:58 +01:00
0001_01_01_000009_drop_brain_memories_workspace_fk.php fix(brain): Postgres portability for brain connection + migrations 2026-04-23 12:32:58 +01:00
0001_01_01_000010_add_source_to_brain_memories.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000010_rename_session_columns.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000011_create_issue_tracker_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
0001_01_01_000012_create_agent_messages_table.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
2026_03_17_000001_create_github_tracking_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
2026_03_31_000001_create_agent_fleet_tables.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
2026_03_31_000002_add_category_to_agent_workspace_states.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00