Skip to content

Commit 2bcad43

Browse files
committed
fix(spec): G2a's indexes.fields help text states the refusal #20479 added
Since object-field-ref-unknown judges indexes[].fields, publishing and os validate refuse an index column that names no field of the object; a draft save (the schema parse) still does not check. A real field that is not a stored column (a formula) is still skipped whole by the SQL driver with a warning. The help text, its comment and its four catalogue leaves now say exactly that. Claude-Session: https://claude.ai/code/session_01ARcDurZ5j34RdqsGgc4jgH Co-authored-by: Claude <noreply@anthropic.com>
1 parent e809f0b commit 2bcad43

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
327327
},
328328
"indexes.fields": {
329329
label: "Fields",
330-
helpText: "Column names of this object, in key order (e.g. status, owner). Nothing checks them when you save or publish: a name that is not a stored column makes the SQL driver skip the whole index, with a warning in the server log."
330+
helpText: "Column names of this object, in key order (e.g. status, owner). Saving does not check them; publishing and os validate refuse a name that is not a field of this object. A field that is not a stored column (a formula, say) makes the SQL driver skip the whole index, with a warning in the server log."
331331
},
332332
"indexes.unique": {
333333
label: "Unique",

‎packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
327327
},
328328
"indexes.fields": {
329329
label: "Campos",
330-
helpText: "Nombres de columna de este objeto, en el orden de la clave (p. ej., status, owner). Nada los comprueba al guardar ni al publicar: un nombre que no sea una columna almacenada hace que el driver SQL omita el índice entero, con una advertencia en el registro del servidor."
330+
helpText: "Nombres de columna de este objeto, en el orden de la clave (p. ej., status, owner). Guardar no los comprueba; publicar y os validate rechazan un nombre que no sea un campo de este objeto. Un campo que no sea una columna almacenada (una fórmula, por ejemplo) hace que el driver SQL omita el índice entero, con una advertencia en el registro del servidor."
331331
},
332332
"indexes.unique": {
333333
label: "Único",

‎packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
327327
},
328328
"indexes.fields": {
329329
label: "フィールド",
330-
helpText: "このオブジェクトの列名を、キーの順に指定します(例:status、owner)。保存時にも公開時にも検査されません。保存される列ではない名前があると、SQL ドライバーはそのインデックス全体をスキップし、サーバーログに警告を出します。"
330+
helpText: "このオブジェクトの列名を、キーの順に指定します(例:status、owner)。保存時には検査されませんが、公開時と os validate では、このオブジェクトのフィールドではない名前が拒否されます。保存される列ではないフィールド(数式など)があると、SQL ドライバーはそのインデックス全体をスキップし、サーバーログに警告を出します。"
331331
},
332332
"indexes.unique": {
333333
label: "一意",

‎packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
327327
},
328328
"indexes.fields": {
329329
label: "字段",
330-
helpText: "本对象的列名,按键的顺序排列(例如 status、owner)。保存或发布时不会检查它们:若某个名称不是已存储的列,SQL 驱动会跳过整个索引,并在服务器日志中记录一条警告。"
330+
helpText: "本对象的列名,按键的顺序排列(例如 status、owner)。保存时不会检查它们;发布和 os validate 会拒绝不是本对象字段的名称。若某个字段不是已存储的列(例如公式字段),SQL 驱动会跳过整个索引,并在服务器日志中记录一条警告。"
331331
},
332332
"indexes.unique": {
333333
label: "唯一",

‎packages/spec/src/data/object.form.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,14 @@ export const objectForm = defineForm({
504504
// (`name`, `fields`, `unique`); `type` and `partial` are tombstones and
505505
// need no row.
506506
//
507-
// `fields` is a free-text list, the `highlightFields` row's face. No
508-
// authoring door judges its names: not the schema parse, not the publish
509-
// door, not `os validate` (`validate-object-field-refs` leaves it to the
510-
// storage layer by design). The SQL driver's `syncDeclaredIndexes` skips
511-
// an index naming a column the table does not have, logging a warning,
512-
// so the help text claims that and no refusal.
507+
// `fields` is a free-text list, the `highlightFields` row's face. The
508+
// schema parse, so a draft save, does not judge its names. Publishing and
509+
// `os validate` refuse one that is not a field of this object
510+
// (`object-field-ref-unknown`, `error`, since #20432). The SQL driver's
511+
// `syncDeclaredIndexes` skips an index naming a column the table does
512+
// not have, logging a warning, which is what still befalls a real field
513+
// that is not a stored column (a formula). The help text claims exactly
514+
// those three.
513515
//
514516
// `unique` is a select over `global` / `organization` ONLY, as the
515517
// ruling says. The node is `boolean | 'global' | 'organization'`: a
@@ -526,7 +528,7 @@ export const objectForm = defineForm({
526528
helpText: 'Database indexes on this object\'s table. The SQL driver creates each one the table lacks when it syncs the table; a sync never drops an index.',
527529
fields: [
528530
{ field: 'name', label: 'Name', type: 'text', helpText: 'Physical index name. Unset: generated from the table and the columns (e.g. idx_task_status).' },
529-
{ field: 'fields', label: 'Fields', widget: 'string-tags', required: true, helpText: 'Column names of this object, in key order (e.g. status, owner). Nothing checks them when you save or publish: a name that is not a stored column makes the SQL driver skip the whole index, with a warning in the server log.' },
531+
{ field: 'fields', label: 'Fields', widget: 'string-tags', required: true, helpText: 'Column names of this object, in key order (e.g. status, owner). Saving does not check them; publishing and os validate refuse a name that is not a field of this object. A field that is not a stored column (a formula, say) makes the SQL driver skip the whole index, with a warning in the server log.' },
530532
{ field: 'unique', label: 'Unique', type: 'select', helpText: 'Uniqueness scope (ADR-0120). Unset: not unique. The deprecated bare true (it means global) is not offered; an index that carries it keeps it until you pick a scope.', options: [
531533
{ label: 'Global — one holder across the installation, over exactly these columns', value: 'global' },
532534
{ label: 'Organization — one holder per organization (the driver prepends the organization column)', value: 'organization' },

0 commit comments

Comments
 (0)