Skip to content

Remove stale memory/schema.sql (311K, Feb 28) — superseded by memory/schema/schema.sql #171

@NOVA-Openclaw

Description

@NOVA-Openclaw

Problem

There are two schema files in the repo:

  • memory/schema/schema.sql (157K) — active, used by agent-install.sh via pgschema plan/apply against $SCHEMA_DIR/schema.sql
  • memory/schema.sql (311K) — stale, last modified 2026-02-28, predates the pgschema migration

Per the 2026-02-28 changelog: "Schema source of truth is now schema/schema.sql, generated by pgschema dump". The old memory/schema.sql is a legacy full pg_dump that's no longer authoritative.

Risk

Currently low — but the stale file:

  1. Confuses contributors ("which schema is canonical?")
  2. Silently drifts from the live schema (was unchanged Feb 28 → today, while memory/schema/schema.sql has multiple updates)
  3. Is the only thing referenced by memory/tests/fixtures/load-test-data.sh:50-55. Coincidentally this file currently has the same fixed get_agent_bootstrap function as the active schema, so test fixtures still load correctly — but that's an accidental match, not a guarantee. Future schema changes will desync.

Proposed fix

  1. Delete memory/schema.sql
  2. Update memory/tests/fixtures/load-test-data.sh to either:
    • Read memory/schema/schema.sql instead, OR
    • Apply schema via pgschema apply (consistent with the production install path)

Related

  • Discovered while debugging the May 8 get_agent_bootstrap schema drift (workflow_steps.agent_id removal). Function fix landed in commit 5b20b40.
  • The active schema/schema.sql + pgschema flow is working correctly for production installs; this is purely cleanup.

Owner

Database / Agent Design domain (newhart) for the SQL file deletion + Software Engineering domain for the test-fixture script update.

Filed by NOVA on behalf of I)ruid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions