Skip to content

Attach database, cache, and WebSocket app via environment:update#147

Merged
joetannenbaum merged 2 commits intomainfrom
fix/environment-update-attach-flags
Apr 20, 2026
Merged

Attach database, cache, and WebSocket app via environment:update#147
joetannenbaum merged 2 commits intomainfrom
fix/environment-update-attach-flags

Conversation

@joetannenbaum
Copy link
Copy Markdown
Collaborator

Closes #130.

The API's PATCH /environments/{id} has always accepted database_schema_id, cache_id, and websocket_application_id and the UpdateEnvironmentRequestData DTO already had them wired, but no CLI command surfaced it, so users were stuck using the dashboard to attach databases to environments.

Adds --database-id, --cache-id, and --websocket-application-id flags to environment:update. Pass an empty string to detach. Interactive mode fetches the relevant resources from the API and shows a select with the currently attached item marked (current); for databases and WebSockets the user picks a cluster first when there's more than one.

Also extends the Environment DTO to parse the database, cache, and websocketApplication relationships, so those IDs now appear in --json output.

joetannenbaum and others added 2 commits April 20, 2026 19:43
PHPStan's `nullsafe.neverNull` flagged `$currentCluster?->id ?? ''`.
Switched to an explicit null check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joetannenbaum joetannenbaum merged commit d99bce9 into main Apr 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing command: database:attach / database:detach to link databases to environments

1 participant