DocsWorkflowsComponentsAppapp:schema:update

app:schema:update

Replaces the metadata of an existing schema

Options

NameTypeDescription
org_idstringThe organization ID that owns the schema
schema_idstringThe name of the schema (database) to update
schemaSchemaThe updated schema metadata to apply
  ↳ namestringIs the schema identifier and maps to the underlying database name (e.g. the MySQL database). Must be unique within an organization.
  ↳ user_idstringIs the owner identifier, stored in _schema_metadata by SQL backends. Used for audit trail and ownership checks.
  ↳ org_idstringScopes the schema to a tenant. All schema and data operations are routed by this id.
  ↳ versionintIs the applied migration count. 0 for an empty schema; incremented by one for each Migration persisted through ApplySchema.
  ↳ tables[]TableIs the ordered list of tables that make up the schema.
    ↳ namestringIs the table identifier and must be unique within a Schema.
    ↳ descriptionstringIs an optional human-readable summary surfaced in generated documentation and GUI tooling. Has no effect on storage.
    ↳ fields[]FieldIs the ordered list of user-defined columns on the table.
      ↳ namestringIs the column / input name. Must be unique within its table or input set and must not collide with reserved record fields (id, created_at, updated_at, deleted_at, version, version_owner_id) when used as a DB column.
      ↳ typeFieldTypeIs the field's data type. See the FieldType constants for the supported values.
      ↳ requiredboolMarks the field as non-nullable / mandatory. Inserts and updates that omit a required field (and provide no Default) are rejected.
      ↳ defaultanyIs the value applied when a record is inserted (or a form is rendered) without an explicit value for this field. A nil or zero value means no default is applied.
      ↳ related_tablestringIs the name of the target table for relation fields. Required when Type is has_one, has_many, or belongs_to; ignored otherwise.
      ↳ related_fieldstringIs the name of the foreign-key field on the related table. Used only by has_many to identify which column on RelatedTable points back to this record.
      ↳ descriptionstringIs a human-readable explanation of the field's purpose. Surfaced in generated documentation and GUI tooling; has no effect on storage or validation.
      ↳ options[]stringIs the ordered list of permitted string values for FieldTypeEnum. Required for enum fields; ignored for all other types.
      ↳ labelstringIs the UI label for the field. Renderers fall back to Name when empty.
      ↳ option_labels[]stringIs a parallel array to Options that carries display labels for enum values. Index i in OptionLabels labels Options[i]. When empty, the value itself is shown.
      ↳ default_sourcestringDeclares the origin of a dynamic default value when the server has resolved one into Default. Allowed sources: "now", "today". The set is closed and intentionally excludes identity sources (org_id, user_id), which are injected as workflow vars by the server, never surfaced as form fields.
      ↳ relation_label_fieldstringNames the field on the related record that the UI should show as the dropdown label. When empty, the renderer falls back to the related record's id. Only meaningful when Type is a relation.
    ↳ indexes[]IndexIs the optional list of secondary indexes defined on the table.
      ↳ namestringIs the index identifier and must be unique within its table.
      ↳ fields[]stringIs the ordered list of field names covered by the index. Order is significant for composite indexes (leftmost-prefix semantics).
      ↳ uniqueboolEnforces that no two records share the same value combination for the indexed fields.
    ↳ versionedboolAdds the per-record version counter and version_owner_id columns to this table. The DataStore increments version on every write and stamps version_owner_id with the writing user, supporting optimistic concurrency and "last edited by" semantics
    ↳ auditedboolEnables per-write audit logging for this table. When true, every successful Insert/Update/Delete records an entry in _schema_audit_log with the actor, source, reason, workflow attribution, and a changed-fields diff (before/after for the keys that actually changed). Independent of Versioned: versioning answers "what did the record look like at point X", auditing answers "who changed what, when, why"
    ↳ configRawMessageIs opaque JSON configuration for the table, persisted in the _schema_tables meta-table. Used by GUI consumers (e.g. column ordering, view definitions) and not interpreted by the engine
  ↳ created_atTimeIs the UTC timestamp when the schema was first persisted.
  ↳ updated_atTimeIs the UTC timestamp of the most recent successful migration.

Outputs

NameTypeDescription
schemaSchemaThe updated schema definition
  ↳ namestringIs the schema identifier and maps to the underlying database name (e.g. the MySQL database). Must be unique within an organization.
  ↳ user_idstringIs the owner identifier, stored in _schema_metadata by SQL backends. Used for audit trail and ownership checks.
  ↳ org_idstringScopes the schema to a tenant. All schema and data operations are routed by this id.
  ↳ versionintIs the applied migration count. 0 for an empty schema; incremented by one for each Migration persisted through ApplySchema.
  ↳ tables[]TableIs the ordered list of tables that make up the schema.
    ↳ namestringIs the table identifier and must be unique within a Schema.
    ↳ descriptionstringIs an optional human-readable summary surfaced in generated documentation and GUI tooling. Has no effect on storage.
    ↳ fields[]FieldIs the ordered list of user-defined columns on the table.
      ↳ namestringIs the column / input name. Must be unique within its table or input set and must not collide with reserved record fields (id, created_at, updated_at, deleted_at, version, version_owner_id) when used as a DB column.
      ↳ typeFieldTypeIs the field's data type. See the FieldType constants for the supported values.
      ↳ requiredboolMarks the field as non-nullable / mandatory. Inserts and updates that omit a required field (and provide no Default) are rejected.
      ↳ defaultanyIs the value applied when a record is inserted (or a form is rendered) without an explicit value for this field. A nil or zero value means no default is applied.
      ↳ related_tablestringIs the name of the target table for relation fields. Required when Type is has_one, has_many, or belongs_to; ignored otherwise.
      ↳ related_fieldstringIs the name of the foreign-key field on the related table. Used only by has_many to identify which column on RelatedTable points back to this record.
      ↳ descriptionstringIs a human-readable explanation of the field's purpose. Surfaced in generated documentation and GUI tooling; has no effect on storage or validation.
      ↳ options[]stringIs the ordered list of permitted string values for FieldTypeEnum. Required for enum fields; ignored for all other types.
      ↳ labelstringIs the UI label for the field. Renderers fall back to Name when empty.
      ↳ option_labels[]stringIs a parallel array to Options that carries display labels for enum values. Index i in OptionLabels labels Options[i]. When empty, the value itself is shown.
      ↳ default_sourcestringDeclares the origin of a dynamic default value when the server has resolved one into Default. Allowed sources: "now", "today". The set is closed and intentionally excludes identity sources (org_id, user_id), which are injected as workflow vars by the server, never surfaced as form fields.
      ↳ relation_label_fieldstringNames the field on the related record that the UI should show as the dropdown label. When empty, the renderer falls back to the related record's id. Only meaningful when Type is a relation.
    ↳ indexes[]IndexIs the optional list of secondary indexes defined on the table.
      ↳ namestringIs the index identifier and must be unique within its table.
      ↳ fields[]stringIs the ordered list of field names covered by the index. Order is significant for composite indexes (leftmost-prefix semantics).
      ↳ uniqueboolEnforces that no two records share the same value combination for the indexed fields.
    ↳ versionedboolAdds the per-record version counter and version_owner_id columns to this table. The DataStore increments version on every write and stamps version_owner_id with the writing user, supporting optimistic concurrency and "last edited by" semantics
    ↳ auditedboolEnables per-write audit logging for this table. When true, every successful Insert/Update/Delete records an entry in _schema_audit_log with the actor, source, reason, workflow attribution, and a changed-fields diff (before/after for the keys that actually changed). Independent of Versioned: versioning answers "what did the record look like at point X", auditing answers "who changed what, when, why"
    ↳ configRawMessageIs opaque JSON configuration for the table, persisted in the _schema_tables meta-table. Used by GUI consumers (e.g. column ordering, view definitions) and not interpreted by the engine
  ↳ created_atTimeIs the UTC timestamp when the schema was first persisted.
  ↳ updated_atTimeIs the UTC timestamp of the most recent successful migration.

Example

name: Update a schema
actions:
  - name: updated
    component: app:schema:update
    vars:
      org_id: "{{ var.org_id }}"
      schema_id: content
      schema:
        name: content
        description: "Editorial content"

outputs:
  schema: "{{ updated.schema }}"