generated from coulomb/repo-seed
feat(db): ORM models + Alembic migrations 0001–0003 — T09/T10/T11
SQLAlchemy ORM (src/activity_core/orm.py):
- ActivityDefinition, ActivityRun, TaskInstance mapped to Base.metadata
- Wired into migrations/env.py for autogenerate support
Migrations (chained 0001 → 0002 → 0003):
- 0001: activity_definitions (id, name, enabled, trigger_type,
trigger_config JSONB, context_sources JSONB, task_templates JSONB,
dedupe_key_strategy, version, created_at, updated_at)
- 0002: activity_runs (run_id, activity_id FK→activity_definitions,
scheduled_for, fired_at, context_snapshot JSONB, tasks_spawned,
version_used) + index on activity_id
- 0003: task_instances (id, run_id FK→activity_runs CASCADE,
type, params JSONB, status, created_at) + index on run_id
Apply with: ACTCORE_DB_URL=... alembic upgrade head
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,15 +40,15 @@ tasks:
|
||||
state_hub_task_id: d9fe3e54-ec1a-4e23-aa76-d8869f4e024d
|
||||
- id: T09
|
||||
title: Write activity_definitions migration
|
||||
status: todo
|
||||
status: done
|
||||
state_hub_task_id: 47774e01-1026-478e-9a46-7d676bfed45c
|
||||
- id: T10
|
||||
title: Write activity_runs migration
|
||||
status: todo
|
||||
status: done
|
||||
state_hub_task_id: 0a74f29f-c07d-4338-be90-e5cf4087261b
|
||||
- id: T11
|
||||
title: Write task_instances migration
|
||||
status: todo
|
||||
status: done
|
||||
state_hub_task_id: 491a6903-8189-43bb-958f-4d16abc84f8e
|
||||
- id: T12
|
||||
title: Seed one example ActivityDefinition
|
||||
|
||||
Reference in New Issue
Block a user