Skip to content

Multi-agent: add user_id column to jobs table #563

@chubes4

Description

@chubes4

Parent: #560

Summary

Add user_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 column to datamachine_jobs table. Denormalized from flow/pipeline for direct query performance.

Code Changes

Schema

  • inc/Core/Database/Jobs/ — add column to CREATE TABLE, add index
  • Migration — ALTER TABLE + backfill from flow's user_id or admin user

Repository Methods

  • create_job() — accept user_id param (set from execution context)
  • get_jobs() / list methods — add optional user_id filter
  • get_job() — no change (by ID)

CLI

  • wp datamachine jobs list — add optional --user flag
  • wp datamachine jobs show — no change (by ID)

Engine

  • Job creation in engine — pull user_id from execution context and persist

Backward Compatibility

  • DEFAULT 0, backfill to admin user
  • Existing jobs are historical — backfill is informational

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions