Skip to main content

environment_patches

Creates, updates, deletes, gets or lists an environment_patches resource.

Overview​

Nameenvironment_patches
TypeResource
Idrailway.environments.environment_patches

Fields​

The following fields are returned by SELECT queries:

One EnvironmentPatch row.

NameDatatypeDescription
idstring
environment_idstring
applied_atstring (date-time)
applied_byobjectAppliedByMember object
created_atstring (date-time)
last_applied_errorstring
messagestring
patchobject
statusstring (APPLYING, COMMITTED, FAILED, STAGED)
updated_atstring (date-time)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidGet a single environment patch by ID. Backed by the Railway GraphQL query environmentPatch.
listselectenvironment_idGet the patches for an environment. Backed by the Railway GraphQL query environmentPatches.
commitexecenvironment_idcommit_message, patch, skip_deploysCommit the provided patch to the environment. Backed by the Railway GraphQL mutation environmentPatchCommit.
restageexecpatch_idCopy a FAILED patch's changes into the environment's staged patch (creating one if needed). The FAILED patch is left untouched. Backed by the Railway GraphQL mutation environmentPatchRestage.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstring
idstring
commit_messagestring
patchobject
patch_idstring
skip_deploysstringSkip deploys for services affected by this patch. Boolean passed as a string, for example 'true'.

SELECT examples​

Get a single environment patch by ID. Backed by the Railway GraphQL query environmentPatch.

SELECT
id,
environment_id,
applied_at,
applied_by,
created_at,
last_applied_error,
message,
patch,
status,
updated_at
FROM railway.environments.environment_patches
WHERE id = '{{ id }}' -- required
;

Lifecycle Methods​

Commit the provided patch to the environment. Backed by the Railway GraphQL mutation environmentPatchCommit.

EXEC railway.environments.environment_patches.commit
@environment_id='{{ environment_id }}', --required
@commit_message='{{ commit_message }}',
@patch='{{ patch }}',
@skip_deploys='{{ skip_deploys }}'
;