Skip to content

db: add slug column to workflow table #1130

@adityachoudhari26

Description

@adityachoudhari26

Part of #1127.

Scope

Add a slug column to the workflow table so workflows are addressable by a human-readable identifier instead of UUID. Workspace-scoped uniqueness.

Changes

  • packages/db/src/schema/workflow.ts: add slug: text("slug").notNull() and a unique index on (workspace_id, slug).
  • Generate Drizzle migration, then hand-edit for backwards compatibility:
    1. Add slug as nullable.
    2. Backfill from name in psql using the same slugify rules the app code will use (lowercase, spaces → -, strip URL-unsafe chars).
    3. Set notNull + add unique index.
  • Pre-flight check: confirm no two existing workflow names slugify to the same value within a workspace before running the migration in prod.

Out of scope

API/UI/SDK changes — covered in sibling issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions