php-agentic/Migrations
Clotho 474f96ee5f
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 3s
CI / PHP 8.4 (pull_request) Failing after 3s
feat: add template version management (#35)
Snapshots YAML template content in a new `plan_template_versions` table
whenever a plan is created from a template. Plans reference their version
via `template_version_id` so existing plans are unaffected by future
template file edits.

Key changes:
- Migration 0006: create `plan_template_versions` table (slug, version,
  name, content JSON, content_hash SHA-256); add nullable FK
  `template_version_id` to `agent_plans`
- Model `PlanTemplateVersion`: `findOrCreateFromTemplate()` deduplicates
  identical content by hash; `historyFor()` returns versions newest-first
- `AgentPlan`: add `template_version_id` fillable and `templateVersion()`
  relationship
- `PlanTemplateService::createPlan()`: snapshot raw template before
  variable substitution; store version id and version number in metadata;
  add `getVersionHistory()` and `getVersion()` public methods
- Tests: `TemplateVersionManagementTest` covering model behaviour, plan
  creation snapshotting, deduplication, history ordering, and service
  methods

Closes #35

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:25:22 +00:00
..
0001_01_01_000001_create_agentic_tables.php fix(migrations): make idempotent and align schemas with models 2026-02-08 21:07:57 +00:00
0001_01_01_000002_add_ip_whitelist_to_agent_api_keys.php fix(migrations): make idempotent and align schemas with models 2026-02-08 21:07:57 +00:00
0001_01_01_000003_create_agent_plans_tables.php fix(migrations): make idempotent and align schemas with models 2026-02-08 21:07:57 +00:00
0001_01_01_000004_create_prompt_tables.php test: add PromptVersion model tests 2026-02-23 05:18:37 +00:00
0001_01_01_000005_add_performance_indexes.php fix: add missing database indexes (closes #21) 2026-02-23 06:29:14 +00:00
0001_01_01_000006_add_template_versions.php feat: add template version management (#35) 2026-02-23 15:25:22 +00:00