n8n/docs/generated/postgres-schema/public.instance_credential_assignment.md
Arvin Ansari 912c63ebca
feat(core): Add a description field to credentials (no-changelog)
Add a nullable `description` column to the credential entity and accept it
on the internal credentials API. A user can now record what a credential is
for and where it belongs.

The column is `text`. The 512-character cap lives in `@n8n/api-types` and
applies in the DTO and the entity validator. A later reader must agree its
truncation limit with this cap.

The value is trimmed on write. A blank value is stored as `null`.

The migration uses a raw `ALTER TABLE`. Several tables hold cascading
foreign keys to `credentials_entity`, so the SQLite table recreation that
`addColumns` triggers would delete their rows.

The public API contract is unchanged.
2026-09-16 14:13:40 +02:00

2.4 KiB
Generated

public.instance_credential_assignment

Columns

Name Type Default Nullable Children Parents Comment
createdAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false
credentialId varchar(36) false public.credentials_entity Credential assigned to the registered use; repositories enforce instance usage scope
credentialUseId varchar(128) false Stable credential use registered with the instance credential broker
updatedAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false

Constraints

Name Type Definition
FK_instance_credential_assignment_credential FOREIGN KEY FOREIGN KEY ("credentialId") REFERENCES credentials_entity(id) ON DELETE RESTRICT
PK_984b0a98726485c9a330cde6b2f PRIMARY KEY PRIMARY KEY ("credentialUseId")
instance_credential_assignment_createdAt_not_null n NOT NULL "createdAt"
instance_credential_assignment_credentialId_not_null n NOT NULL "credentialId"
instance_credential_assignment_credentialUseId_not_null n NOT NULL "credentialUseId"
instance_credential_assignment_updatedAt_not_null n NOT NULL "updatedAt"

Indexes

Name Definition
IDX_9626b8dc1bee96a86a3ee09d73 CREATE INDEX "IDX_9626b8dc1bee96a86a3ee09d73" ON public.instance_credential_assignment USING btree ("credentialId")
PK_984b0a98726485c9a330cde6b2f CREATE UNIQUE INDEX "PK_984b0a98726485c9a330cde6b2f" ON public.instance_credential_assignment USING btree ("credentialUseId")

Relations

erDiagram

"public.instance_credential_assignment" }o--|| "public.credentials_entity" : "FOREIGN KEY (#quot;credentialId#quot;) REFERENCES credentials_entity(id) ON DELETE RESTRICT"

"public.instance_credential_assignment" {
  timestamp_3__with_time_zone createdAt
  varchar_36_ credentialId FK
  varchar_128_ credentialUseId
  timestamp_3__with_time_zone updatedAt
}
"public.credentials_entity" {
  timestamp_3__with_time_zone createdAt
  text data
  text description
  varchar_36_ id
  boolean isGlobal
  boolean isManaged
  boolean isResolvable
  varchar_128_ name
  boolean resolvableAllowFallback
  varchar_16_ resolverId FK
  varchar_128_ type
  timestamp_3__with_time_zone updatedAt
  varchar_16_ usageScope
}

Generated by tbls