Skip to content

Commit b4acea5

Browse files
Copilothuangyiirene
andcommitted
Address code review: extract ObjectUpdateChanges interface and clarify import paths
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent 4600be9 commit b4acea5

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

examples/schema-migration-example.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
* These migration instructions express declarative schema changes that
88
* can be interpreted by migration tools or AI agents to safely evolve
99
* your data model over time.
10+
*
11+
* Note: This example uses a relative import path for demonstration purposes
12+
* within the monorepo. In your application, import from the package:
13+
*
14+
* ```typescript
15+
* import { MigrationConfig, ... } from '@objectql/types';
16+
* ```
1017
*/
1118

1219
import {

packages/foundation/types/src/migration.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ export interface FieldDeleteInstruction extends BaseSchemaChangeInstruction {
8888
archive_location?: string;
8989
}
9090

91+
/**
92+
* Configuration changes that can be applied to an object.
93+
* Used by ObjectUpdateInstruction to modify object metadata.
94+
*/
95+
export interface ObjectUpdateChanges {
96+
/** Updated human-readable label */
97+
label?: string;
98+
/** Updated icon string */
99+
icon?: string;
100+
/** Updated description */
101+
description?: string;
102+
/** Updated datasource name */
103+
datasource?: string;
104+
}
105+
91106
/**
92107
* Instruction to update (modify) an object definition.
93108
* Can rename or change properties of an existing object.
@@ -102,12 +117,7 @@ export interface ObjectUpdateInstruction extends BaseSchemaChangeInstruction {
102117
new_object_name?: string;
103118

104119
/** Updated properties (label, description, icon, etc.) */
105-
changes: {
106-
label?: string;
107-
icon?: string;
108-
description?: string;
109-
datasource?: string;
110-
};
120+
changes: ObjectUpdateChanges;
111121
}
112122

113123
/**

0 commit comments

Comments
 (0)