Skip to content

backfill env field for existing root projects #3839

@elias-ba

Description

@elias-ba

Problem

Root projects created before the env field was added to the projects table have NULL env values. This causes the environment chip to not display in the workflow editor and inspector for these existing projects.

Root Cause

The env field was added in migration 20250824190735_add_sandbox_fields_to_projects.exs, but existing projects were not backfilled. The changeset in Project.changeset/2 only sets env = 'main' for new root projects being created.

Expected Behavior

All root projects should have env = 'main' so that the environment chip displays correctly.

Solution

Add a data migration to backfill env = 'main' for all root projects (where parent_id IS NULL) that currently have env IS NULL.

Metadata

Metadata

Assignees

Labels

bugNewly identified bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions