Skip to content

The open alternative to Salesforce, designed for AI.

Improve builder return type (#14592)

Paul Rastoin235eef32f679
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/constant/empty-orchestrator-actions-report.constant.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/constant/empty-orchestrator-actions-report.constant.ts
new file mode 100644
index 00000000000..7522c194f83
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/constant/empty-orchestrator-actions-report.constant.ts
@@ -0,0 +1,18 @@
+import { type OrchestratorActionsReport } from 'src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type';
+import { type CreatedDeletedUpdatedActions } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service';
+import { type WorkspaceMigrationActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-action-common-v2';
+
+const emptyCreatedDeletedUpdated: CreatedDeletedUpdatedActions<WorkspaceMigrationActionV2> =
+ {
+ created: [],
+ deleted: [],
+ updated: [],
+ };
+
+export const EMPTY_ORCHESTRATOR_ACTIONS_REPORT = {
+ index: emptyCreatedDeletedUpdated,
+ objectMetadata: emptyCreatedDeletedUpdated,
+ view: emptyCreatedDeletedUpdated,
+ viewField: emptyCreatedDeletedUpdated,
+ fieldMetadata: emptyCreatedDeletedUpdated,
+} as const satisfies OrchestratorActionsReport;
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/services/workspace-migration-build-orchestrator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/services/workspace-migration-build-orchestrator.service.ts
index 14cd18a0a9d..e3c3556905d 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/services/workspace-migration-build-orchestrator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/services/workspace-migration-build-orchestrator.service.ts
@@ -4,6 +4,7 @@ import { isDefined } from 'twenty-shared/utils';
import { EMPTY_ALL_FLAT_ENTITY_MAPS } from 'src/engine/core-modules/common/constant/empty-all-flat-entity-maps.constant';
import { AllFlatEntityMaps } from 'src/engine/core-modules/common/types/all-flat-entity-maps.type';
+import { EMPTY_ORCHESTRATOR_ACTIONS_REPORT } from 'src/engine/workspace-manager/workspace-migration-v2/constant/empty-orchestrator-actions-report.constant';
import {
OrchestratorFailureReport,
WorkspaceMigrationOrchestratorBuildArgs,
@@ -14,7 +15,6 @@ import { WorkspaceMigrationV2IndexActionsBuilderService } from 'src/engine/works
import { WorkspaceMigrationV2ViewFieldActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/view-field/workspace-migration-v2-view-field-actions-builder.service';
import { WorkspaceMigrationV2ViewActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/view/workspace-migration-v2-view-actions-builder.service';
import { WorkspaceMigrationBuilderV2Service } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service';
-import { WorkspaceMigrationActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-action-common-v2';
@Injectable()
export class WorkspaceMigrationBuildOrchestratorService {
@@ -69,7 +69,9 @@ export class WorkspaceMigrationBuildOrchestratorService {
| WorkspaceMigrationOrchestratorFailedResult
| WorkspaceMigrationOrchestratorSuccessfulResult
> {
- const allActions: WorkspaceMigrationActionV2[] = [];
+ const orchestratorActionsReport = structuredClone({
+ ...EMPTY_ORCHESTRATOR_ACTIONS_REPORT,
+ });
const orchestratorFailureReport: OrchestratorFailureReport = {
objectMetadata: [],
view: [],
@@ -96,7 +98,6 @@ export class WorkspaceMigrationBuildOrchestratorService {
await this.workspaceMigrationBuilderV2Service.validateAndBuild({
fromFlatObjectMetadataMaps,
toFlatObjectMetadataMaps,
- workspaceId,
buildOptions,
});
@@ -106,7 +107,8 @@ export class WorkspaceMigrationBuildOrchestratorService {
if (objectResult.status === 'fail') {
orchestratorFailureReport.objectMetadata.push(...objectResult.errors);
} else {
- allActions.push(...objectResult.workspaceMigration.actions);
+ orchestratorActionsReport.fieldMetadata = objectResult.fieldsActions;
+ orchestratorActionsReport.objectMetadata = objectResult.objectActions;
}
}
@@ -131,7 +133,7 @@ export class WorkspaceMigrationBuildOrchestratorService {
if (indexResult.status === 'fail') {
orchestratorFailureReport.index.push(...indexResult.errors);
} else {
- allActions.push(...indexResult.actions);
+ orchestratorActionsReport.index = indexResult.actions;
}
}
@@ -156,7 +158,7 @@ export class WorkspaceMigrationBuildOrchestratorService {
if (viewResult.status === 'fail') {
orchestratorFailureReport.view.push(...viewResult.errors);
} else {
- allActions.push(...viewResult.actions);
+ orchestratorActionsReport.view = viewResult.actions;
}
}
@@ -183,7 +185,7 @@ export class WorkspaceMigrationBuildOrchestratorService {
if (viewFieldResult.status === 'fail') {
orchestratorFailureReport.viewField.push(...viewFieldResult.errors);
} else {
- allActions.push(...viewFieldResult.actions);
+ orchestratorActionsReport.viewField = viewFieldResult.actions;
}
}
@@ -204,7 +206,28 @@ export class WorkspaceMigrationBuildOrchestratorService {
status: 'success',
workspaceMigration: {
relatedFlatEntityMapsKeys,
- actions: allActions,
+ actions: [
+ // Object and fields
+ ...orchestratorActionsReport.fieldMetadata.deleted,
+ ...orchestratorActionsReport.index.deleted,
+ ...orchestratorActionsReport.objectMetadata.deleted,
+ ...orchestratorActionsReport.objectMetadata.created,
+ ...orchestratorActionsReport.index.created,
+ ...orchestratorActionsReport.objectMetadata.updated,
+ ...orchestratorActionsReport.fieldMetadata.created,
+ ...orchestratorActionsReport.fieldMetadata.updated,
+ ...orchestratorActionsReport.index.updated,
+ ///
+
+ // Views
+ ...orchestratorActionsReport.view.deleted,
+ ...orchestratorActionsReport.view.created,
+ ...orchestratorActionsReport.view.updated,
+ ...orchestratorActionsReport.viewField.deleted,
+ ...orchestratorActionsReport.viewField.created,
+ ...orchestratorActionsReport.viewField.updated,
+ ///
+ ],
workspaceId,
},
};
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type.ts
index 5dd4b65a882..bba49c3cbc0 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type.ts
@@ -3,7 +3,9 @@ import { type FromTo } from 'twenty-shared/types';
import { type AllFlatEntitiesByMetadataEngineName } from 'src/engine/core-modules/common/types/all-flat-entities-by-metadata-engine-name.type';
import { type AllFlatEntityMaps } from 'src/engine/core-modules/common/types/all-flat-entity-maps.type';
import { type FailedFlatEntityValidation } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/types/failed-flat-entity-validation.type';
+import { type CreatedDeletedUpdatedActions } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service';
import { type WorkspaceMigrationV2BuilderOptions } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service';
+import { type WorkspaceMigrationActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-action-common-v2';
import { type WorkspaceMigrationV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-v2';
export type WorkspaceMigrationOrchestratorBuildArgs = {
@@ -21,6 +23,12 @@ export type OrchestratorFailureReport = {
>[];
};
+export type OrchestratorActionsReport = {
+ [P in keyof AllFlatEntitiesByMetadataEngineName]: CreatedDeletedUpdatedActions<WorkspaceMigrationActionV2>;
+} & {
+ fieldMetadata: CreatedDeletedUpdatedActions<WorkspaceMigrationActionV2>;
+};
+
export type WorkspaceMigrationOrchestratorFailedResult = {
status: 'fail';
report: OrchestratorFailureReport;
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/__snapshots__/workspace-migration-builder.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/__snapshots__/workspace-migration-builder.spec.ts.snap
index 626930b4e3e..4642ca08122 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/__snapshots__/workspace-migration-builder.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/__snapshots__/workspace-migration-builder.spec.ts.snap
@@ -1,66 +1,53 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Workspace migration builder field actions test suite It should NOT build an update_field action for a field RELATION uncovered fields mutation 1`] = `[]`;
+exports[`Workspace migration builder field actions test suite It should NOT build an update_field action for a field RELATION uncovered fields mutation 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
-exports[`Workspace migration builder field actions test suite It should build a delete_field action 1`] = `
-[
- {
- "fieldMetadataId": Any<String>,
- "objectMetadataId": Any<String>,
- "type": "delete_field",
- },
-]
+exports[`Workspace migration builder field actions test suite It should NOT build an update_field action for a field RELATION uncovered fields mutation 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
`;
-exports[`Workspace migration builder field actions test suite It should build an create_field action 1`] = `
-[
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "default flat field metadata description",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "icon",
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "flat field metadata label",
- "morphId": null,
- "name": "flatFieldMetadataName",
+exports[`Workspace migration builder field actions test suite It should build a delete_field action 1`] = `
+{
+ "created": [],
+ "deleted": [
+ {
+ "fieldMetadataId": Any<String>,
"objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "delete_field",
},
- "type": "create_field",
- },
-]
+ ],
+ "updated": [],
+}
`;
-exports[`Workspace migration builder field actions test suite It should build an create_field action for a RELATION field 1`] = `
-[
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "default flat field metadata description",
- "flatRelationTargetFieldMetadata": {
+exports[`Workspace migration builder field actions test suite It should build a delete_field action 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an create_field action 1`] = `
+{
+ "created": [
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
"description": "default flat field metadata description",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
"icon": "icon",
"id": Any<String>,
"isActive": true,
@@ -75,87 +62,72 @@ exports[`Workspace migration builder field actions test suite It should build an
"name": "flatFieldMetadataName",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "sourceWhatever",
- "onDelete": undefined,
- "relationType": "ONE_TO_MANY",
- },
- "standardId": null,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "flatRelationTargetObjectMetadata": {
- "createdAt": Any<String>,
- "description": "A rocket",
- "duplicateCriteria": null,
- "icon": "IconRocket",
- "id": Any<String>,
- "imageIdentifierFieldMetadataId": null,
- "isActive": true,
- "isAuditLogged": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "labelIdentifierFieldMetadataId": Any<String>,
- "labelPlural": "Rockets",
- "labelSingular": "Rocket",
- "namePlural": "rockets",
- "nameSingular": "rocket",
- "shortcut": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": null,
"standardOverrides": null,
- "targetTableName": "DEPRECATED",
+ "type": "TEXT",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "icon": "icon",
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "flat field metadata label",
- "morphId": null,
- "name": "flatFieldMetadataName",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "whatever",
- "onDelete": undefined,
- "relationType": "MANY_TO_ONE",
- },
- "standardId": null,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "default flat field metadata description",
- "flatRelationTargetFieldMetadata": {
+ ],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an create_field action 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an create_field action for a RELATION field 1`] = `
+{
+ "created": [
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
"description": "default flat field metadata description",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "default flat field metadata description",
+ "icon": "icon",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "flat field metadata label",
+ "morphId": null,
+ "name": "flatFieldMetadataName",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "sourceWhatever",
+ "onDelete": undefined,
+ "relationType": "ONE_TO_MANY",
+ },
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
"flatRelationTargetObjectMetadata": {
"createdAt": Any<String>,
"description": "A rocket",
@@ -212,785 +184,550 @@ exports[`Workspace migration builder field actions test suite It should build an
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": {
- "createdAt": Any<String>,
- "description": null,
- "duplicateCriteria": null,
- "icon": "IconCat",
- "id": Any<String>,
- "imageIdentifierFieldMetadataId": null,
- "isActive": true,
- "isAuditLogged": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "labelIdentifierFieldMetadataId": Any<String>,
- "labelPlural": "Pets",
- "labelSingular": "Pet",
- "namePlural": "pets",
- "nameSingular": "pet",
- "shortcut": null,
- "standardId": null,
- "standardOverrides": null,
- "targetTableName": "DEPRECATED",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "icon": "icon",
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "flat field metadata label",
- "morphId": null,
- "name": "flatFieldMetadataName",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "sourceWhatever",
- "onDelete": undefined,
- "relationType": "ONE_TO_MANY",
- },
- "standardId": null,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
-]
-`;
-
-exports[`Workspace migration builder field actions test suite It should build an update_field action for a RELATION field 1`] = `
-[
- {
- "fieldMetadataId": Any<String>,
- "objectMetadataId": Any<String>,
- "type": "update_field",
- "updates": [
- {
- "from": null,
- "property": "description",
- "to": "new description",
- },
- {
- "from": "Species",
- "property": "label",
- "to": "new label",
- },
- ],
- "workspaceId": Any<String>,
- },
-]
-`;
-
-exports[`Workspace migration builder field actions test suite It should build an update_field action for custom fields 1`] = `
-[
- {
- "fieldMetadataId": Any<String>,
- "objectMetadataId": Any<String>,
- "type": "update_field",
- "updates": [
- {
- "from": null,
- "property": "description",
- "to": "new description",
- },
- {
- "from": null,
- "property": "icon",
- "to": "new icon",
- },
- ],
- "workspaceId": Any<String>,
- },
-]
-`;
-
-exports[`Workspace migration builder field actions test suite It should build an update_field action for standard field 1`] = `
-[
- {
- "fieldMetadataId": Any<String>,
- "objectMetadataId": Any<String>,
- "type": "update_field",
- "updates": [
- {
- "from": null,
- "property": "standardOverrides",
- "to": {
- "description": "new description",
- "icon": "new icon",
- },
- },
- ],
- "workspaceId": Any<String>,
- },
-]
-`;
-
-exports[`Workspace migration builder field actions test suite It should not infer any actions as from and to fields are identical 1`] = `[]`;
-
-exports[`Workspace migration builder object actions test suite It should build a create_object action with custom object 1`] = `
-[
- {
- "createFieldActions": [
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "uuid",
- "description": "Id",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "Icon123",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Id",
- "morphId": null,
- "name": "id",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "UUID",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "'Untitled'",
- "description": "Name",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconAbc",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Name",
- "morphId": null,
- "name": "name",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Creation date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendar",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Creation date",
- "morphId": null,
- "name": "createdAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Last time the record was changed",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Last update",
- "morphId": null,
- "name": "updatedAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "default flat field metadata description",
+ "flatRelationTargetFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "Deletion date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
+ "description": "default flat field metadata description",
+ "flatRelationTargetObjectMetadata": {
+ "createdAt": Any<String>,
+ "description": "A rocket",
+ "duplicateCriteria": null,
+ "icon": "IconRocket",
+ "id": Any<String>,
+ "imageIdentifierFieldMetadataId": null,
+ "isActive": true,
+ "isAuditLogged": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isRemote": false,
+ "isSearchable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "labelIdentifierFieldMetadataId": Any<String>,
+ "labelPlural": "Rockets",
+ "labelSingular": "Rocket",
+ "namePlural": "rockets",
+ "nameSingular": "rocket",
+ "shortcut": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "targetTableName": "DEPRECATED",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "icon": "icon",
"id": Any<String>,
"isActive": true,
- "isCustom": false,
+ "isCustom": true,
"isLabelSyncedWithName": false,
"isNullable": true,
"isSystem": false,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Deleted at",
+ "label": "flat field metadata label",
"morphId": null,
- "name": "deletedAt",
+ "name": "flatFieldMetadataName",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "whatever",
+ "onDelete": undefined,
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": null,
"standardOverrides": null,
- "type": "DATE_TIME",
+ "type": "RELATION",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
+ "flatRelationTargetObjectMetadata": {
"createdAt": Any<String>,
- "defaultValue": {
- "name": "''",
- "source": "'MANUAL'",
- },
- "description": "The creator of the record",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCreativeCommonsSa",
+ "description": null,
+ "duplicateCriteria": null,
+ "icon": "IconCat",
"id": Any<String>,
+ "imageIdentifierFieldMetadataId": null,
"isActive": true,
- "isCustom": false,
+ "isAuditLogged": true,
+ "isCustom": true,
"isLabelSyncedWithName": false,
- "isNullable": false,
+ "isRemote": false,
+ "isSearchable": true,
"isSystem": false,
"isUIReadOnly": false,
- "isUnique": false,
- "label": "Created by",
- "morphId": null,
- "name": "createdBy",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
+ "labelIdentifierFieldMetadataId": Any<String>,
+ "labelPlural": "Pets",
+ "labelSingular": "Pet",
+ "namePlural": "pets",
+ "nameSingular": "pet",
+ "shortcut": null,
+ "standardId": null,
"standardOverrides": null,
- "type": "ACTOR",
+ "targetTableName": "DEPRECATED",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "type": "create_field",
+ "icon": "icon",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "flat field metadata label",
+ "morphId": null,
+ "name": "flatFieldMetadataName",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "sourceWhatever",
+ "onDelete": undefined,
+ "relationType": "ONE_TO_MANY",
+ },
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": 0,
- "description": "Position",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHierarchy2",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Position",
- "morphId": null,
- "name": "position",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "POSITION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
+ },
+ ],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an create_field action for a RELATION field 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for a RELATION field 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [
+ {
+ "fieldMetadataId": Any<String>,
+ "objectMetadataId": Any<String>,
+ "type": "update_field",
+ "updates": [
+ {
+ "from": null,
+ "property": "description",
+ "to": "new description",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TimelineActivities tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "from": "Species",
+ "property": "label",
+ "to": "new label",
+ },
+ ],
+ "workspaceId": Any<String>,
+ },
+ ],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for a RELATION field 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for custom fields 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [
+ {
+ "fieldMetadataId": Any<String>,
+ "objectMetadataId": Any<String>,
+ "type": "update_field",
+ "updates": [
+ {
+ "from": null,
+ "property": "description",
+ "to": "new description",
+ },
+ {
+ "from": null,
+ "property": "icon",
+ "to": "new icon",
+ },
+ ],
+ "workspaceId": Any<String>,
+ },
+ ],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for custom fields 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for standard field 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [
+ {
+ "fieldMetadataId": Any<String>,
+ "objectMetadataId": Any<String>,
+ "type": "update_field",
+ "updates": [
+ {
+ "from": null,
+ "property": "standardOverrides",
+ "to": {
+ "description": "new description",
+ "icon": "new icon",
+ },
+ },
+ ],
+ "workspaceId": Any<String>,
+ },
+ ],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should build an update_field action for standard field 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should not infer any actions as from and to fields are identical 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder field actions test suite It should not infer any actions as from and to fields are identical 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a create_object action with custom object 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a create_object action with custom object 2`] = `
+{
+ "created": [
+ {
+ "createFieldActions": [
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "TimelineActivities Rocket",
- "icon": "IconBuildingSkyscraper",
+ "defaultValue": "uuid",
+ "description": "Id",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "Icon123",
"id": Any<String>,
"isActive": true,
"isCustom": false,
"isLabelSyncedWithName": false,
- "isNullable": true,
+ "isNullable": false,
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Id",
"morphId": null,
- "name": "rocket",
+ "name": "id",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
- },
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": Any<String>,
"standardOverrides": null,
- "type": "RELATION",
+ "type": "UUID",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconTimelineEvent",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TimelineActivities",
- "morphId": null,
- "name": "timelineActivities",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Favorites tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "Favorites Rocket",
- "icon": "IconBuildingSkyscraper",
+ "defaultValue": "'Untitled'",
+ "description": "Name",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconAbc",
"id": Any<String>,
"isActive": true,
"isCustom": false,
"isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
+ "isNullable": false,
+ "isSystem": false,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Name",
"morphId": null,
- "name": "rocket",
+ "name": "name",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
- },
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": Any<String>,
"standardOverrides": null,
- "type": "RELATION",
+ "type": "TEXT",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHeart",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Favorites",
- "morphId": null,
- "name": "favorites",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Attachments tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "Attachments Rocket",
- "icon": "IconBuildingSkyscraper",
+ "defaultValue": "now",
+ "description": "Creation date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendar",
"id": Any<String>,
"isActive": true,
"isCustom": false,
"isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
+ "isNullable": false,
+ "isSystem": false,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Creation date",
"morphId": null,
- "name": "rocket",
+ "name": "createdAt",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
- },
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": Any<String>,
"standardOverrides": null,
- "type": "RELATION",
+ "type": "DATE_TIME",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconFileImport",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Attachments",
- "morphId": null,
- "name": "attachments",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "now",
+ "description": "Last time the record was changed",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Last update",
+ "morphId": null,
+ "name": "updatedAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "NoteTargets tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "NoteTargets Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "Deletion date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
"id": Any<String>,
"isActive": true,
"isCustom": false,
"isLabelSyncedWithName": false,
"isNullable": true,
- "isSystem": true,
+ "isSystem": false,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Deleted at",
"morphId": null,
- "name": "rocket",
+ "name": "deletedAt",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
- },
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": Any<String>,
"standardOverrides": null,
- "type": "RELATION",
+ "type": "DATE_TIME",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "NoteTargets",
- "morphId": null,
- "name": "noteTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "name": "''",
+ "source": "'MANUAL'",
+ },
+ "description": "The creator of the record",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCreativeCommonsSa",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Created by",
+ "morphId": null,
+ "name": "createdBy",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "ACTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TaskTargets tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "TaskTargets Rocket",
- "icon": "IconBuildingSkyscraper",
+ "defaultValue": 0,
+ "description": "Position",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHierarchy2",
"id": Any<String>,
"isActive": true,
"isCustom": false,
"isLabelSyncedWithName": false,
- "isNullable": true,
+ "isNullable": false,
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Position",
"morphId": null,
- "name": "rocket",
+ "name": "position",
"objectMetadataId": Any<String>,
"options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
- },
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
"standardId": Any<String>,
"standardOverrides": null,
- "type": "RELATION",
+ "type": "POSITION",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TaskTargets",
- "morphId": null,
- "name": "taskTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Field used for full-text search",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": false,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Search vector",
- "morphId": null,
- "name": "searchVector",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TS_VECTOR",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- ],
- "flatObjectMetadataWithoutFields": {
- "createdAt": Any<String>,
- "description": "A rocket",
- "duplicateCriteria": null,
- "icon": "IconRocket",
- "id": Any<String>,
- "imageIdentifierFieldMetadataId": null,
- "isActive": true,
- "isAuditLogged": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "labelIdentifierFieldMetadataId": Any<String>,
- "labelPlural": "Rockets",
- "labelSingular": "Rocket",
- "namePlural": "rockets",
- "nameSingular": "rocket",
- "shortcut": null,
- "standardId": null,
- "standardOverrides": null,
- "targetTableName": "DEPRECATED",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_object",
- },
-]
-`;
-
-exports[`Workspace migration builder object actions test suite It should build a create_object action with standard object 1`] = `
-[
- {
- "createFieldActions": [
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "NoteTargets tied to the Pet",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "NoteTargets Pet",
- "icon": "IconBuildingSkyscraper",
+ "description": "TimelineActivities tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TimelineActivities Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconTimelineEvent",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -999,17 +736,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Pet",
+ "label": "TimelineActivities",
"morphId": null,
- "name": "pet",
+ "name": "timelineActivities",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "petId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -1018,279 +753,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "NoteTargets",
- "morphId": null,
- "name": "noteTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "uuid",
- "description": "Id",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "Icon123",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Id",
- "morphId": null,
- "name": "id",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "UUID",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "'Untitled'",
- "description": "Name",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconAbc",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Name",
- "morphId": null,
- "name": "name",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Creation date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendar",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Creation date",
- "morphId": null,
- "name": "createdAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Last time the record was changed",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Last update",
- "morphId": null,
- "name": "updatedAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Deletion date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Deleted at",
- "morphId": null,
- "name": "deletedAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "name": "''",
- "source": "'MANUAL'",
- },
- "description": "The creator of the record",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCreativeCommonsSa",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Created by",
- "morphId": null,
- "name": "createdBy",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "ACTOR",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": 0,
- "description": "Position",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHierarchy2",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Position",
- "morphId": null,
- "name": "position",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "POSITION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TimelineActivities tied to the Pet",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "TimelineActivities Pet",
- "icon": "IconBuildingSkyscraper",
+ "description": "Favorites tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Favorites Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHeart",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -1299,17 +802,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Pet",
+ "label": "Favorites",
"morphId": null,
- "name": "pet",
+ "name": "favorites",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "petId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -1318,45 +819,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconTimelineEvent",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TimelineActivities",
- "morphId": null,
- "name": "timelineActivities",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Favorites tied to the Pet",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "Favorites Pet",
- "icon": "IconBuildingSkyscraper",
+ "description": "Attachments tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Attachments Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconFileImport",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -1365,17 +868,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Pet",
+ "label": "Attachments",
"morphId": null,
- "name": "pet",
+ "name": "attachments",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "petId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -1384,45 +885,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHeart",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Favorites",
- "morphId": null,
- "name": "favorites",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Attachments tied to the Pet",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "Attachments Pet",
- "icon": "IconBuildingSkyscraper",
+ "description": "NoteTargets tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "NoteTargets Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -1431,17 +934,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Pet",
+ "label": "NoteTargets",
"morphId": null,
- "name": "pet",
+ "name": "noteTargets",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "petId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -1450,45 +951,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconFileImport",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Attachments",
- "morphId": null,
- "name": "attachments",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TaskTargets tied to the Pet",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "TaskTargets Pet",
- "icon": "IconBuildingSkyscraper",
+ "description": "TaskTargets tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TaskTargets Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -1497,17 +1000,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Pet",
+ "label": "TaskTargets",
"morphId": null,
- "name": "pet",
+ "name": "taskTargets",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "petId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -1516,1022 +1017,1683 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TaskTargets",
- "morphId": null,
- "name": "taskTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Field used for full-text search",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": false,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Search vector",
+ "morphId": null,
+ "name": "searchVector",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "TS_VECTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Field used for full-text search",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": false,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Search vector",
- "morphId": null,
- "name": "searchVector",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TS_VECTOR",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
- },
- "type": "create_field",
+ ],
+ "flatObjectMetadataWithoutFields": {
+ "createdAt": Any<String>,
+ "description": "A rocket",
+ "duplicateCriteria": null,
+ "icon": "IconRocket",
+ "id": Any<String>,
+ "imageIdentifierFieldMetadataId": null,
+ "isActive": true,
+ "isAuditLogged": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isRemote": false,
+ "isSearchable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "labelIdentifierFieldMetadataId": Any<String>,
+ "labelPlural": "Rockets",
+ "labelSingular": "Rocket",
+ "namePlural": "rockets",
+ "nameSingular": "rocket",
+ "shortcut": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "targetTableName": "DEPRECATED",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Species",
- "morphId": null,
- "name": "species",
- "objectMetadataId": Any<String>,
- "options": [
- {
- "color": "blue",
- "id": Any<String>,
- "label": "Dog",
- "position": 0,
- "value": "DOG",
- },
- {
- "color": "red",
+ "type": "create_object",
+ },
+ ],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a create_object action with standard object 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a create_object action with standard object 2`] = `
+{
+ "created": [
+ {
+ "createFieldActions": [
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "NoteTargets tied to the Pet",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "NoteTargets Pet",
+ "icon": "IconBuildingSkyscraper",
"id": Any<String>,
- "label": "Cat",
- "position": 1,
- "value": "CAT",
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pet",
+ "morphId": null,
+ "name": "pet",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "petId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "color": "green",
- "id": Any<String>,
- "label": "Bird",
- "position": 2,
- "value": "BIRD",
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "NoteTargets",
+ "morphId": null,
+ "name": "noteTargets",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "relationType": "ONE_TO_MANY",
},
- {
- "color": "yellow",
- "id": Any<String>,
- "label": "Fish",
- "position": 3,
- "value": "FISH",
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "uuid",
+ "description": "Id",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "Icon123",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Id",
+ "morphId": null,
+ "name": "id",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "UUID",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "'Untitled'",
+ "description": "Name",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconAbc",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Name",
+ "morphId": null,
+ "name": "name",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "TEXT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "now",
+ "description": "Creation date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendar",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Creation date",
+ "morphId": null,
+ "name": "createdAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "now",
+ "description": "Last time the record was changed",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Last update",
+ "morphId": null,
+ "name": "updatedAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Deletion date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Deleted at",
+ "morphId": null,
+ "name": "deletedAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "name": "''",
+ "source": "'MANUAL'",
},
- {
- "color": "purple",
+ "description": "The creator of the record",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCreativeCommonsSa",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Created by",
+ "morphId": null,
+ "name": "createdBy",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "ACTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": 0,
+ "description": "Position",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHierarchy2",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Position",
+ "morphId": null,
+ "name": "position",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "POSITION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TimelineActivities tied to the Pet",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TimelineActivities Pet",
+ "icon": "IconBuildingSkyscraper",
"id": Any<String>,
- "label": "Rabbit",
- "position": 4,
- "value": "RABBIT",
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pet",
+ "morphId": null,
+ "name": "pet",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "petId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "color": "orange",
- "id": Any<String>,
- "label": "Hamster",
- "position": 5,
- "value": "HAMSTER",
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconTimelineEvent",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "TimelineActivities",
+ "morphId": null,
+ "name": "timelineActivities",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "relationType": "ONE_TO_MANY",
},
- ],
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "SELECT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Traits",
- "morphId": null,
- "name": "traits",
- "objectMetadataId": Any<String>,
- "options": [
- {
- "color": "blue",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Favorites tied to the Pet",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Favorites Pet",
+ "icon": "IconBuildingSkyscraper",
"id": Any<String>,
- "label": "Playful",
- "position": 0,
- "value": "PLAYFUL",
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pet",
+ "morphId": null,
+ "name": "pet",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "petId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "color": "red",
- "id": Any<String>,
- "label": "Friendly",
- "position": 1,
- "value": "FRIENDLY",
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHeart",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Favorites",
+ "morphId": null,
+ "name": "favorites",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "relationType": "ONE_TO_MANY",
},
- {
- "color": "green",
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Attachments tied to the Pet",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Attachments Pet",
+ "icon": "IconBuildingSkyscraper",
"id": Any<String>,
- "label": "Protective",
- "position": 2,
- "value": "PROTECTIVE",
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pet",
+ "morphId": null,
+ "name": "pet",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "petId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "color": "yellow",
- "id": Any<String>,
- "label": "Shy",
- "position": 3,
- "value": "SHY",
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconFileImport",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Attachments",
+ "morphId": null,
+ "name": "attachments",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "relationType": "ONE_TO_MANY",
},
- {
- "color": "purple",
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TaskTargets tied to the Pet",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TaskTargets Pet",
+ "icon": "IconBuildingSkyscraper",
"id": Any<String>,
- "label": "Brave",
- "position": 4,
- "value": "BRAVE",
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pet",
+ "morphId": null,
+ "name": "pet",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "petId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- {
- "color": "orange",
- "id": Any<String>,
- "label": "Curious",
- "position": 5,
- "value": "CURIOUS",
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "TaskTargets",
+ "morphId": null,
+ "name": "taskTargets",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "relationType": "ONE_TO_MANY",
},
- ],
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "MULTI_SELECT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "''",
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Comments",
- "morphId": null,
- "name": "comments",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Field used for full-text search",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": false,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Search vector",
+ "morphId": null,
+ "name": "searchVector",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "TS_VECTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Age",
- "morphId": null,
- "name": "age",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "NUMBER",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Species",
+ "morphId": null,
+ "name": "species",
+ "objectMetadataId": Any<String>,
+ "options": [
+ {
+ "color": "blue",
+ "id": Any<String>,
+ "label": "Dog",
+ "position": 0,
+ "value": "DOG",
+ },
+ {
+ "color": "red",
+ "id": Any<String>,
+ "label": "Cat",
+ "position": 1,
+ "value": "CAT",
+ },
+ {
+ "color": "green",
+ "id": Any<String>,
+ "label": "Bird",
+ "position": 2,
+ "value": "BIRD",
+ },
+ {
+ "color": "yellow",
+ "id": Any<String>,
+ "label": "Fish",
+ "position": 3,
+ "value": "FISH",
+ },
+ {
+ "color": "purple",
+ "id": Any<String>,
+ "label": "Rabbit",
+ "position": 4,
+ "value": "RABBIT",
+ },
+ {
+ "color": "orange",
+ "id": Any<String>,
+ "label": "Hamster",
+ "position": 5,
+ "value": "HAMSTER",
+ },
+ ],
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "SELECT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "addressCity": "''",
- "addressCountry": "''",
- "addressLat": null,
- "addressLng": null,
- "addressPostcode": "''",
- "addressState": "''",
- "addressStreet1": "''",
- "addressStreet2": "''",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Traits",
+ "morphId": null,
+ "name": "traits",
+ "objectMetadataId": Any<String>,
+ "options": [
+ {
+ "color": "blue",
+ "id": Any<String>,
+ "label": "Playful",
+ "position": 0,
+ "value": "PLAYFUL",
+ },
+ {
+ "color": "red",
+ "id": Any<String>,
+ "label": "Friendly",
+ "position": 1,
+ "value": "FRIENDLY",
+ },
+ {
+ "color": "green",
+ "id": Any<String>,
+ "label": "Protective",
+ "position": 2,
+ "value": "PROTECTIVE",
+ },
+ {
+ "color": "yellow",
+ "id": Any<String>,
+ "label": "Shy",
+ "position": 3,
+ "value": "SHY",
+ },
+ {
+ "color": "purple",
+ "id": Any<String>,
+ "label": "Brave",
+ "position": 4,
+ "value": "BRAVE",
+ },
+ {
+ "color": "orange",
+ "id": Any<String>,
+ "label": "Curious",
+ "position": 5,
+ "value": "CURIOUS",
+ },
+ ],
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "MULTI_SELECT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Location",
- "morphId": null,
- "name": "location",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "ADDRESS",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "additionalPhones": null,
- "primaryPhoneCallingCode": "''",
- "primaryPhoneCountryCode": "''",
- "primaryPhoneNumber": "''",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "''",
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Comments",
+ "morphId": null,
+ "name": "comments",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "TEXT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Vet phone",
- "morphId": null,
- "name": "vetPhone",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "PHONES",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "additionalEmails": null,
- "primaryEmail": "''",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Age",
+ "morphId": null,
+ "name": "age",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "NUMBER",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Vet email",
- "morphId": null,
- "name": "vetEmail",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "EMAILS",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Birthday",
- "morphId": null,
- "name": "birthday",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "DATE",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "addressCity": "''",
+ "addressCountry": "''",
+ "addressLat": null,
+ "addressLng": null,
+ "addressPostcode": "''",
+ "addressState": "''",
+ "addressStreet1": "''",
+ "addressStreet2": "''",
+ },
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Location",
+ "morphId": null,
+ "name": "location",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "ADDRESS",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Is good with kids",
- "morphId": null,
- "name": "isGoodWithKids",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "BOOLEAN",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "additionalPhones": null,
+ "primaryPhoneCallingCode": "''",
+ "primaryPhoneCountryCode": "''",
+ "primaryPhoneNumber": "''",
+ },
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Vet phone",
+ "morphId": null,
+ "name": "vetPhone",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "PHONES",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "primaryLinkLabel": "''",
- "primaryLinkUrl": "''",
- "secondaryLinks": [],
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "additionalEmails": null,
+ "primaryEmail": "''",
+ },
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Vet email",
+ "morphId": null,
+ "name": "vetEmail",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "EMAILS",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Pictures",
- "morphId": null,
- "name": "pictures",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "LINKS",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "amountMicros": null,
- "currencyCode": "''",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Birthday",
+ "morphId": null,
+ "name": "birthday",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "DATE",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Average cost of kibble per month",
- "morphId": null,
- "name": "averageCostOfKibblePerMonth",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "CURRENCY",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "firstName": "''",
- "lastName": "''",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Is good with kids",
+ "morphId": null,
+ "name": "isGoodWithKids",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "BOOLEAN",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Makes its owner think of",
- "morphId": null,
- "name": "makesOwnerThinkOf",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "FULL_NAME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Sound swag (bark style, meow style, etc.)",
- "morphId": null,
- "name": "soundSwag",
- "objectMetadataId": Any<String>,
- "options": [
- {
- "id": Any<String>,
- "label": "1",
- "position": 0,
- "value": "RATING_1",
- },
- {
- "id": Any<String>,
- "label": "2",
- "position": 1,
- "value": "RATING_2",
- },
- {
- "id": Any<String>,
- "label": "3",
- "position": 2,
- "value": "RATING_3",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "primaryLinkLabel": "''",
+ "primaryLinkUrl": "''",
+ "secondaryLinks": [],
},
- {
- "id": Any<String>,
- "label": "4",
- "position": 3,
- "value": "RATING_4",
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Pictures",
+ "morphId": null,
+ "name": "pictures",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "LINKS",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "amountMicros": null,
+ "currencyCode": "''",
},
- {
- "id": Any<String>,
- "label": "5",
- "position": 4,
- "value": "RATING_5",
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Average cost of kibble per month",
+ "morphId": null,
+ "name": "averageCostOfKibblePerMonth",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "CURRENCY",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "firstName": "''",
+ "lastName": "''",
},
- ],
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "RATING",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Makes its owner think of",
+ "morphId": null,
+ "name": "makesOwnerThinkOf",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "FULL_NAME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Bio",
- "morphId": null,
- "name": "bio",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "RICH_TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Sound swag (bark style, meow style, etc.)",
+ "morphId": null,
+ "name": "soundSwag",
+ "objectMetadataId": Any<String>,
+ "options": [
+ {
+ "id": Any<String>,
+ "label": "1",
+ "position": 0,
+ "value": "RATING_1",
+ },
+ {
+ "id": Any<String>,
+ "label": "2",
+ "position": 1,
+ "value": "RATING_2",
+ },
+ {
+ "id": Any<String>,
+ "label": "3",
+ "position": 2,
+ "value": "RATING_3",
+ },
+ {
+ "id": Any<String>,
+ "label": "4",
+ "position": 3,
+ "value": "RATING_4",
+ },
+ {
+ "id": Any<String>,
+ "label": "5",
+ "position": 4,
+ "value": "RATING_5",
+ },
+ ],
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "RATING",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Interesting facts",
- "morphId": null,
- "name": "interestingFacts",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "ARRAY",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Bio",
+ "morphId": null,
+ "name": "bio",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "RICH_TEXT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": null,
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Extra data",
- "morphId": null,
- "name": "extraData",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": null,
- "standardOverrides": null,
- "type": "RAW_JSON",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Interesting facts",
+ "morphId": null,
+ "name": "interestingFacts",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "ARRAY",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
+ },
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": null,
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Extra data",
+ "morphId": null,
+ "name": "extraData",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "type": "RAW_JSON",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
+ ],
+ "flatObjectMetadataWithoutFields": {
+ "createdAt": Any<String>,
+ "description": null,
+ "duplicateCriteria": null,
+ "icon": "IconCat",
+ "id": Any<String>,
+ "imageIdentifierFieldMetadataId": null,
+ "isActive": true,
+ "isAuditLogged": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isRemote": false,
+ "isSearchable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "labelIdentifierFieldMetadataId": Any<String>,
+ "labelPlural": "Pets",
+ "labelSingular": "Pet",
+ "namePlural": "pets",
+ "nameSingular": "pet",
+ "shortcut": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "targetTableName": "DEPRECATED",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- ],
- "flatObjectMetadataWithoutFields": {
- "createdAt": Any<String>,
- "description": null,
- "duplicateCriteria": null,
- "icon": "IconCat",
- "id": Any<String>,
- "imageIdentifierFieldMetadataId": null,
- "isActive": true,
- "isAuditLogged": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "labelIdentifierFieldMetadataId": Any<String>,
- "labelPlural": "Pets",
- "labelSingular": "Pet",
- "namePlural": "pets",
- "nameSingular": "pet",
- "shortcut": null,
- "standardId": null,
- "standardOverrides": null,
- "targetTableName": "DEPRECATED",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_object",
},
- "type": "create_object",
- },
-]
+ ],
+ "deleted": [],
+ "updated": [],
+}
`;
exports[`Workspace migration builder object actions test suite It should build a create_object and create_index actions for each of this fieldMetadata 1`] = `
-[
- {
- "createFieldActions": [
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "uuid",
- "description": "Id",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "Icon123",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Id",
- "morphId": null,
- "name": "id",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "UUID",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a create_object and create_index actions for each of this fieldMetadata 2`] = `
+{
+ "created": [
+ {
+ "createFieldActions": [
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "uuid",
+ "description": "Id",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "Icon123",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Id",
+ "morphId": null,
+ "name": "id",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "UUID",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "'Untitled'",
- "description": "Name",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconAbc",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Name",
- "morphId": null,
- "name": "name",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TEXT",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "'Untitled'",
+ "description": "Name",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconAbc",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Name",
+ "morphId": null,
+ "name": "name",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "TEXT",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Creation date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendar",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Creation date",
- "morphId": null,
- "name": "createdAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "now",
+ "description": "Creation date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendar",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Creation date",
+ "morphId": null,
+ "name": "createdAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": "now",
- "description": "Last time the record was changed",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Last update",
- "morphId": null,
- "name": "updatedAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": "now",
+ "description": "Last time the record was changed",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Last update",
+ "morphId": null,
+ "name": "updatedAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Deletion date",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCalendarClock",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Deleted at",
- "morphId": null,
- "name": "deletedAt",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "DATE_TIME",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Deletion date",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCalendarClock",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Deleted at",
+ "morphId": null,
+ "name": "deletedAt",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "DATE_TIME",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": {
- "name": "''",
- "source": "'MANUAL'",
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": {
+ "name": "''",
+ "source": "'MANUAL'",
+ },
+ "description": "The creator of the record",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCreativeCommonsSa",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Created by",
+ "morphId": null,
+ "name": "createdBy",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "ACTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- "description": "The creator of the record",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCreativeCommonsSa",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": false,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Created by",
- "morphId": null,
- "name": "createdBy",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "ACTOR",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": 0,
- "description": "Position",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHierarchy2",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": false,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Position",
- "morphId": null,
- "name": "position",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "POSITION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": 0,
+ "description": "Position",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHierarchy2",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": false,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Position",
+ "morphId": null,
+ "name": "position",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "POSITION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TimelineActivities tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "TimelineActivities Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "TimelineActivities tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TimelineActivities Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconTimelineEvent",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -2540,17 +2702,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "TimelineActivities",
"morphId": null,
- "name": "rocket",
+ "name": "timelineActivities",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -2559,45 +2719,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconTimelineEvent",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TimelineActivities",
- "morphId": null,
- "name": "timelineActivities",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Favorites tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "Favorites Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "Favorites tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Favorites Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconHeart",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -2606,17 +2768,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Favorites",
"morphId": null,
- "name": "rocket",
+ "name": "favorites",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -2625,45 +2785,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconHeart",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Favorites",
- "morphId": null,
- "name": "favorites",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Attachments tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "Attachments Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "Attachments tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Attachments Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconFileImport",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -2672,17 +2834,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "Attachments",
"morphId": null,
- "name": "rocket",
+ "name": "attachments",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -2691,45 +2851,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconFileImport",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Attachments",
- "morphId": null,
- "name": "attachments",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "NoteTargets tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "NoteTargets Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "NoteTargets tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "NoteTargets Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -2738,17 +2900,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "NoteTargets",
"morphId": null,
- "name": "rocket",
+ "name": "noteTargets",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -2757,45 +2917,47 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "NoteTargets",
- "morphId": null,
- "name": "noteTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "TaskTargets tied to the Rocket",
- "flatRelationTargetFieldMetadata": {
+ {
+ "flatFieldMetadata": {
"createdAt": Any<String>,
"defaultValue": null,
- "description": "TaskTargets Rocket",
- "icon": "IconBuildingSkyscraper",
+ "description": "TaskTargets tied to the Rocket",
+ "flatRelationTargetFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "TaskTargets Rocket",
+ "icon": "IconBuildingSkyscraper",
+ "id": Any<String>,
+ "isActive": true,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Rocket",
+ "morphId": null,
+ "name": "rocket",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": Any<String>,
+ "relationTargetObjectMetadataId": Any<String>,
+ "settings": {
+ "joinColumnName": "rocketId",
+ "onDelete": "CASCADE",
+ "relationType": "MANY_TO_ONE",
+ },
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "RELATION",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "flatRelationTargetObjectMetadata": null,
+ "icon": "IconCheckbox",
"id": Any<String>,
"isActive": true,
"isCustom": false,
@@ -2804,17 +2966,15 @@ exports[`Workspace migration builder object actions test suite It should build a
"isSystem": true,
"isUIReadOnly": false,
"isUnique": false,
- "label": "Rocket",
+ "label": "TaskTargets",
"morphId": null,
- "name": "rocket",
+ "name": "taskTargets",
"objectMetadataId": Any<String>,
"options": null,
"relationTargetFieldMetadataId": Any<String>,
"relationTargetObjectMetadataId": Any<String>,
"settings": {
- "joinColumnName": "rocketId",
- "onDelete": "CASCADE",
- "relationType": "MANY_TO_ONE",
+ "relationType": "ONE_TO_MANY",
},
"standardId": Any<String>,
"standardOverrides": null,
@@ -2823,174 +2983,195 @@ exports[`Workspace migration builder object actions test suite It should build a
"updatedAt": Any<String>,
"workspaceId": Any<String>,
},
- "flatRelationTargetObjectMetadata": null,
- "icon": "IconCheckbox",
- "id": Any<String>,
- "isActive": true,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "TaskTargets",
- "morphId": null,
- "name": "taskTargets",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": Any<String>,
- "relationTargetObjectMetadataId": Any<String>,
- "settings": {
- "relationType": "ONE_TO_MANY",
- },
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "RELATION",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_field",
},
- "type": "create_field",
- },
- {
- "flatFieldMetadata": {
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Field used for full-text search",
- "flatRelationTargetFieldMetadata": null,
- "flatRelationTargetObjectMetadata": null,
- "icon": null,
- "id": Any<String>,
- "isActive": false,
- "isCustom": false,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": true,
- "isUIReadOnly": false,
- "isUnique": false,
- "label": "Search vector",
- "morphId": null,
- "name": "searchVector",
- "objectMetadataId": Any<String>,
- "options": null,
- "relationTargetFieldMetadataId": null,
- "relationTargetObjectMetadataId": null,
- "settings": null,
- "standardId": Any<String>,
- "standardOverrides": null,
- "type": "TS_VECTOR",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ {
+ "flatFieldMetadata": {
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Field used for full-text search",
+ "flatRelationTargetFieldMetadata": null,
+ "flatRelationTargetObjectMetadata": null,
+ "icon": null,
+ "id": Any<String>,
+ "isActive": false,
+ "isCustom": false,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": true,
+ "isUIReadOnly": false,
+ "isUnique": false,
+ "label": "Search vector",
+ "morphId": null,
+ "name": "searchVector",
+ "objectMetadataId": Any<String>,
+ "options": null,
+ "relationTargetFieldMetadataId": null,
+ "relationTargetObjectMetadataId": null,
+ "settings": null,
+ "standardId": Any<String>,
+ "standardOverrides": null,
+ "type": "TS_VECTOR",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
+ },
+ "type": "create_field",
},
- "type": "create_field",
+ ],
+ "flatObjectMetadataWithoutFields": {
+ "createdAt": Any<String>,
+ "description": "A rocket",
+ "duplicateCriteria": null,
+ "icon": "IconRocket",
+ "id": Any<String>,
+ "imageIdentifierFieldMetadataId": null,
+ "isActive": true,
+ "isAuditLogged": true,
+ "isCustom": true,
+ "isLabelSyncedWithName": false,
+ "isRemote": false,
+ "isSearchable": true,
+ "isSystem": false,
+ "isUIReadOnly": false,
+ "labelIdentifierFieldMetadataId": Any<String>,
+ "labelPlural": "Rockets",
+ "labelSingular": "Rocket",
+ "namePlural": "rockets",
+ "nameSingular": "rocket",
+ "shortcut": null,
+ "standardId": null,
+ "standardOverrides": null,
+ "targetTableName": "DEPRECATED",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ "workspaceId": Any<String>,
},
- ],
- "flatObjectMetadataWithoutFields": {
- "createdAt": Any<String>,
- "description": "A rocket",
- "duplicateCriteria": null,
- "icon": "IconRocket",
- "id": Any<String>,
- "imageIdentifierFieldMetadataId": null,
- "isActive": true,
- "isAuditLogged": true,
- "isCustom": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUIReadOnly": false,
- "labelIdentifierFieldMetadataId": Any<String>,
- "labelPlural": "Rockets",
- "labelSingular": "Rocket",
- "namePlural": "rockets",
- "nameSingular": "rocket",
- "shortcut": null,
- "standardId": null,
- "standardOverrides": null,
- "targetTableName": "DEPRECATED",
- "universalIdentifier": Any<String>,
- "updatedAt": Any<String>,
- "workspaceId": Any<String>,
+ "type": "create_object",
},
- "type": "create_object",
- },
- {
- "flatIndexMetadata": {
- "createdAt": Any<ClockDate>,
- "flatIndexFieldMetadatas": [],
- "id": Any<String>,
- "indexType": "BTREE",
- "indexWhereClause": null,
- "isCustom": false,
- "isUnique": false,
- "name": "defaultFlatIndexMetadataName",
- "objectMetadataId": Any<String>,
- "universalIdentifier": Any<String>,
- "updatedAt": Any<ClockDate>,
- "workspaceId": Any<String>,
- },
- "type": "create_index",
- },
-]
+ ],
+ "deleted": [],
+ "updated": [],
+}
`;
exports[`Workspace migration builder object actions test suite It should build a delete_object action with custom deactivated object 1`] = `
-[
- {
- "objectMetadataId": Any<String>,
- "type": "delete_object",
- },
-]
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a delete_object action with custom deactivated object 2`] = `
+{
+ "created": [],
+ "deleted": [
+ {
+ "objectMetadataId": Any<String>,
+ "type": "delete_object",
+ },
+ ],
+ "updated": [],
+}
`;
exports[`Workspace migration builder object actions test suite It should build a delete_object action with standard activated object 1`] = `
-[
- {
- "objectMetadataId": Any<String>,
- "type": "delete_object",
- },
-]
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build a delete_object action with standard activated object 2`] = `
+{
+ "created": [],
+ "deleted": [
+ {
+ "objectMetadataId": Any<String>,
+ "type": "delete_object",
+ },
+ ],
+ "updated": [],
+}
`;
exports[`Workspace migration builder object actions test suite It should build an update_object for custom object 1`] = `
-[
- {
- "objectMetadataId": Any<String>,
- "type": "update_object",
- "updates": [
- {
- "from": "pets",
- "property": "namePlural",
- "to": "prastoins",
- },
- {
- "from": "pet",
- "property": "nameSingular",
- "to": "prastouin",
- },
- ],
- },
-]
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build an update_object for custom object 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [
+ {
+ "objectMetadataId": Any<String>,
+ "type": "update_object",
+ "updates": [
+ {
+ "from": "pets",
+ "property": "namePlural",
+ "to": "prastoins",
+ },
+ {
+ "from": "pet",
+ "property": "nameSingular",
+ "to": "prastouin",
+ },
+ ],
+ },
+ ],
+}
`;
exports[`Workspace migration builder object actions test suite It should build an update_object for standard object 1`] = `
-[
- {
- "objectMetadataId": Any<String>,
- "type": "update_object",
- "updates": [
- {
- "from": null,
- "property": "standardOverrides",
- "to": {
- "description": "Updated description",
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should build an update_object for standard object 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [
+ {
+ "objectMetadataId": Any<String>,
+ "type": "update_object",
+ "updates": [
+ {
+ "from": null,
+ "property": "standardOverrides",
+ "to": {
+ "description": "Updated description",
+ },
},
- },
- ],
- },
-]
+ ],
+ },
+ ],
+}
+`;
+
+exports[`Workspace migration builder object actions test suite It should not infer any actions as from and to are identical 1`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
`;
-exports[`Workspace migration builder object actions test suite It should not infer any actions as from and to are identical 1`] = `[]`;
+exports[`Workspace migration builder object actions test suite It should not infer any actions as from and to are identical 2`] = `
+{
+ "created": [],
+ "deleted": [],
+ "updated": [],
+}
+`;
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-field-test-case.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-field-test-case.ts
index d8d84100f04..2f1ae652dc2 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-field-test-case.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-field-test-case.ts
@@ -19,9 +19,6 @@ import { ROCKET_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object
import { type WorkspaceMigrationBuilderTestCase } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type';
import { fromFlatObjectMetadataToFlatObjectMetadataWithoutFields } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/utils/from-flat-object-metadata-to-flat-object-metadata-without-fields.util';
-// TODO prastoin test defaultValue and settings updates
-// TODO prastoin test standard abstraction in TDD style
-
const relationTestCases: WorkspaceMigrationBuilderTestCase[] = [
{
title: 'It should build an create_field action for a RELATION field',
@@ -92,9 +89,6 @@ const relationTestCases: WorkspaceMigrationBuilderTestCase[] = [
toFlatObjectMetadataMaps,
};
},
- expectedActionsTypeCounter: {
- createField: 2,
- },
},
},
{
@@ -112,9 +106,6 @@ const relationTestCases: WorkspaceMigrationBuilderTestCase[] = [
flatObjectMetadataMaps: FLAT_OBJECT_METADATA_MAPS_MOCKS,
}),
},
- expectedActionsTypeCounter: {
- updateField: 1,
- },
},
},
{
@@ -159,9 +150,6 @@ const basicCrudTestCases: WorkspaceMigrationBuilderTestCase[] = [
flatObjectMetadataMaps: FLAT_OBJECT_METADATA_MAPS_MOCKS,
}),
},
- expectedActionsTypeCounter: {
- createField: 1,
- },
},
},
{
@@ -181,9 +169,6 @@ const basicCrudTestCases: WorkspaceMigrationBuilderTestCase[] = [
}),
}),
},
- expectedActionsTypeCounter: {
- updateField: 1,
- },
},
},
{
@@ -201,9 +186,6 @@ const basicCrudTestCases: WorkspaceMigrationBuilderTestCase[] = [
}),
}),
},
- expectedActionsTypeCounter: {
- updateField: 1,
- },
},
},
{
@@ -224,9 +206,6 @@ const basicCrudTestCases: WorkspaceMigrationBuilderTestCase[] = [
flatObjectMetadataMaps: FLAT_OBJECT_METADATA_MAPS_MOCKS,
}),
},
- expectedActionsTypeCounter: {
- deleteField: 1,
- },
},
},
];
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-object-test-case.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-object-test-case.ts
index 5fe98548f41..0ffd13c0007 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-object-test-case.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-object-test-case.ts
@@ -33,9 +33,6 @@ const DELETE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
},
),
},
- expectedActionsTypeCounter: {
- deleteObject: 1,
- },
},
},
{
@@ -55,9 +52,6 @@ const DELETE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
},
),
},
- expectedActionsTypeCounter: {
- deleteObject: 1,
- },
},
},
];
@@ -79,9 +73,6 @@ const CREATE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
...STANDARD_RELATION_TARGET_FLAT_OBJECT_METADATA_MOCKS,
]),
},
- expectedActionsTypeCounter: {
- createObject: 1,
- },
},
},
{
@@ -100,19 +91,12 @@ const CREATE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
...STANDARD_RELATION_TARGET_FLAT_OBJECT_METADATA_MOCKS,
]),
},
- expectedActionsTypeCounter: {
- createObject: 1,
- },
},
},
{
title:
'It should build a create_object and create_index actions for each of this fieldMetadata',
context: {
- expectedActionsTypeCounter: {
- createIndex: 1,
- createObject: 1,
- },
input: {
fromFlatObjectMetadataMaps:
fromFlatObjectMetadatasToFlatObjectMetadataMaps([
@@ -153,9 +137,6 @@ const UPDATE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
}),
}),
},
- expectedActionsTypeCounter: {
- updateObject: 1,
- },
},
},
{
@@ -174,9 +155,6 @@ const UPDATE_OBJECT_TEST_CASES: WorkspaceMigrationBuilderTestCase[] = [
}),
}),
},
- expectedActionsTypeCounter: {
- updateObject: 1,
- },
},
},
];
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type.ts
index a2869693918..c0e4f523bc5 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type.ts
@@ -21,5 +21,4 @@ export type WorkspaceMigrationBuilderTestCase = EachTestingContext<{
input:
| TestWorkspaceMigrationBuildArgs
| (() => TestWorkspaceMigrationBuildArgs);
- expectedActionsTypeCounter?: ExpectedActionCounters;
}>;
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/workspace-migration-builder.spec.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/workspace-migration-builder.spec.ts
index 2ed03184ec4..1421099bd96 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/workspace-migration-builder.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/workspace-migration-builder.spec.ts
@@ -1,6 +1,5 @@
import { extractRecordIdsAndDatesAsExpectAny } from 'test/utils/extract-record-ids-and-dates-as-expect-any';
import { eachTestingContextFilter } from 'twenty-shared/testing';
-import { capitalize } from 'twenty-shared/utils';
import { type FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { FlatFieldMetadataTypeValidatorService } from 'src/engine/metadata-modules/flat-field-metadata/services/flat-field-metadata-type-validator.service';
@@ -8,15 +7,11 @@ import { FlatFieldMetadataValidatorService } from 'src/engine/metadata-modules/f
import { FlatObjectMetadataValidatorService } from 'src/engine/metadata-modules/flat-object-metadata/services/flat-object-metadata-validator.service';
import { WORKSPACE_MIGRATION_FIELD_BUILDER_TEST_CASES } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-field-test-case';
import { WORKSPACE_MIGRATION_OBJECT_BUILDER_TEST_CASES } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/common/workspace-migration-builder-object-test-case';
-import {
- type CamelCasedWorkspaceMigrationActionsType,
- type ExpectedActionCounters,
- type WorkspaceMigrationBuilderTestCase,
-} from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type';
+import { type WorkspaceMigrationBuilderTestCase } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/__tests__/types/workspace-migration-builder-test-case.type';
import { WorkspaceMigrationV2FieldActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/field/services/workspace-migration-v2-field-actions-builder.service';
import { WorkspaceMigrationV2ObjectActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/object/services/workspace-migration-v2-object-actions-builder.service';
import { WorkspaceMigrationBuilderV2Service } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service';
-import { type WorkspaceMigrationV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-v2';
+``;
const allWorkspaceBuilderTestCases: {
label: string;
@@ -32,45 +27,6 @@ const allWorkspaceBuilderTestCases: {
},
];
-// TODO prastoin add coverage to infer deletion from missing entities
-const expectedActionsTypeCounterChecker = ({
- expectedActionsTypeCounter,
- workspaceMigration,
-}: {
- workspaceMigration: WorkspaceMigrationV2;
- expectedActionsTypeCounter?: ExpectedActionCounters;
-}) => {
- const initialAcc: ExpectedActionCounters = {
- createField: 0,
- createIndex: 0,
- createObject: 0,
- deleteField: 0,
- deleteIndex: 0,
- deleteObject: 0,
- updateField: 0,
- updateObject: 0,
- };
- const actualActionsTypeCounter = workspaceMigration.actions.reduce(
- (acc, action) => {
- const { type } = action;
- const [operation, target] = type.split('_');
- const formattedActionKey =
- `${operation}${capitalize(target)}` as CamelCasedWorkspaceMigrationActionsType;
-
- return {
- ...acc,
- [formattedActionKey]: (acc[formattedActionKey] ?? 0) + 1,
- };
- },
- initialAcc,
- );
-
- expect(actualActionsTypeCounter).toEqual({
- ...initialAcc,
- ...expectedActionsTypeCounter,
- });
-};
-
describe.each(allWorkspaceBuilderTestCases)(
'Workspace migration builder $label actions test suite',
({ testCases }) => {
@@ -114,7 +70,7 @@ describe.each(allWorkspaceBuilderTestCases)(
it.each(eachTestingContextFilter(testCases))(
'$title',
- async ({ context: { input, expectedActionsTypeCounter } }) => {
+ async ({ context: { input } }) => {
const {
fromFlatObjectMetadataMaps,
toFlatObjectMetadataMaps,
@@ -127,22 +83,21 @@ describe.each(allWorkspaceBuilderTestCases)(
buildOptions,
fromFlatObjectMetadataMaps,
toFlatObjectMetadataMaps,
- workspaceId: '20202020-52cc-4c64-ad63-76c26fc3a1e1',
});
expect(validateAndBuildResult.status).toBe('success');
if (validateAndBuildResult.status !== 'success') {
throw new Error('Should never occur');
}
-
- expectedActionsTypeCounterChecker({
- expectedActionsTypeCounter,
- workspaceMigration: validateAndBuildResult.workspaceMigration,
- });
- const { actions } = validateAndBuildResult.workspaceMigration;
-
- expect(actions).toMatchSnapshot(
- actions.map(extractRecordIdsAndDatesAsExpectAny),
+ expect(validateAndBuildResult.fieldsActions).toMatchSnapshot(
+ extractRecordIdsAndDatesAsExpectAny(
+ validateAndBuildResult.fieldsActions,
+ ),
+ );
+ expect(validateAndBuildResult.objectActions).toMatchSnapshot(
+ extractRecordIdsAndDatesAsExpectAny(
+ validateAndBuildResult.objectActions,
+ ),
);
},
);
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service.ts
index ef80d0ea56f..3cd2fa53197 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service.ts
@@ -16,12 +16,20 @@ import { type FailedFlatEntityValidation } from 'src/engine/workspace-manager/wo
import { type WorkspaceMigrationV2BuilderOptions } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service';
import { type WorkspaceMigrationActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-action-common-v2';
+export type CreatedDeletedUpdatedActions<
+ TActions extends WorkspaceMigrationActionV2,
+> = {
+ created: TActions[];
+ deleted: TActions[];
+ updated: TActions[];
+};
+
export type SuccessfulEntityMigrationBuildResult<
TActions extends WorkspaceMigrationActionV2,
TFlatEntity extends FlatEntity,
> = {
status: 'success';
- actions: TActions[];
+ actions: CreatedDeletedUpdatedActions<TActions>;
optimisticFlatEntityMaps: FlatEntityMaps<TFlatEntity>;
};
@@ -57,10 +65,7 @@ export type ValidateAndBuilActionsReturnType<
TActions extends WorkspaceMigrationActionV2,
> = {
failed: FailedFlatEntityValidation<TFlatEntity>[];
- created: TActions[];
- deleted: TActions[];
- updated: TActions[];
-};
+} & CreatedDeletedUpdatedActions<TActions>;
export type FlatEntityValidationArgs<
TFlatEntity extends FlatEntity,
@@ -219,11 +224,11 @@ export abstract class WorkspaceEntityMigrationBuilderV2Service<
return {
status: 'success',
- actions: [
- ...validateAndBuildResult.deleted,
- ...validateAndBuildResult.created,
- ...validateAndBuildResult.updated,
- ],
+ actions: {
+ created: validateAndBuildResult.created,
+ deleted: validateAndBuildResult.deleted,
+ updated: validateAndBuildResult.updated,
+ },
optimisticFlatEntityMaps,
};
}
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service.ts
index 9744b7cdd74..a8816fa8f2b 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-migration-builder-v2.service.ts
@@ -9,9 +9,10 @@ import { deletedCreatedUpdatedMatrixDispatcher } from 'src/engine/workspace-mana
import { WorkspaceMigrationV2FieldActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/field/services/workspace-migration-v2-field-actions-builder.service';
import { WorkspaceMigrationV2ObjectActionsBuilderService } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/object/services/workspace-migration-v2-object-actions-builder.service';
import { FailedFlatEntityValidation } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/types/failed-flat-entity-validation.type';
-import { WorkspaceMigrationV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-v2';
+import { CreatedDeletedUpdatedActions } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/services/workspace-entity-migration-builder-v2.service';
+import { WorkspaceMigrationFieldActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-field-action-v2';
+import { WorkspaceMigrationObjectActionV2 } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/types/workspace-migration-object-action-v2';
import { computeUpdatedObjectMetadataDeletedCreatedUpdatedFieldMatrix } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/utils/compute-updated-object-metadata-deleted-created-updated-field-matrix.util';
-import { getWorkspaceMigrationV2CreateIndexAction } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/utils/get-workspace-migration-v2-index-actions';
export type WorkspaceMigrationV2BuilderOptions = {
inferDeletionFromMissingEntities: boolean;
@@ -20,7 +21,8 @@ export type WorkspaceMigrationV2BuilderOptions = {
export type SuccessfulWorkspaceMigrationBuildResult = {
status: 'success';
- workspaceMigration: WorkspaceMigrationV2;
+ objectActions: CreatedDeletedUpdatedActions<WorkspaceMigrationObjectActionV2>;
+ fieldsActions: CreatedDeletedUpdatedActions<WorkspaceMigrationFieldActionV2>;
optimisticFlatObjectMetadataMaps: FlatObjectMetadataMaps;
};
@@ -31,7 +33,6 @@ export type FailedWorkspaceMigrationBuildResult = {
};
export type WorkspaceMigrationBuildArgs = {
- workspaceId: string;
buildOptions: WorkspaceMigrationV2BuilderOptions;
} & FromTo<FlatObjectMetadataMaps, 'FlatObjectMetadataMaps'>;
// TODO deprecate this file
@@ -45,11 +46,10 @@ export class WorkspaceMigrationBuilderV2Service {
public async validateAndBuild({
fromFlatObjectMetadataMaps,
toFlatObjectMetadataMaps,
- workspaceId,
buildOptions,
}: WorkspaceMigrationBuildArgs): Promise<
- | SuccessfulWorkspaceMigrationBuildResult
| FailedWorkspaceMigrationBuildResult
+ | SuccessfulWorkspaceMigrationBuildResult
> {
const fromFlatObjectMetadatas =
fromFlatObjectMetadataMapsToFlatObjectMetadatas(
@@ -99,13 +99,6 @@ export class WorkspaceMigrationBuilderV2Service {
},
);
- const createdObjectMetadataCreateIndexActions =
- createdFlatObjectMetadatas.flatMap((objectMetadata) =>
- objectMetadata.flatIndexMetadatas.map(
- getWorkspaceMigrationV2CreateIndexAction,
- ),
- );
-
const allValidateAndBuildResultFailures = [
...objectActionsValidateAndBuildResult.failed,
...fieldActionsValidateAndBuildResult.failed,
@@ -122,17 +115,15 @@ export class WorkspaceMigrationBuilderV2Service {
return {
status: 'success',
- workspaceMigration: {
- workspaceId,
- actions: [
- ...fieldActionsValidateAndBuildResult.deleted, // Should be handled separately from objects
- ...objectActionsValidateAndBuildResult.deleted,
- ...objectActionsValidateAndBuildResult.created,
- ...objectActionsValidateAndBuildResult.updated,
- ...fieldActionsValidateAndBuildResult.created, // Should be handled separately from objects
- ...fieldActionsValidateAndBuildResult.updated, // Should be handled separately from objects
- ...createdObjectMetadataCreateIndexActions,
- ],
+ fieldsActions: {
+ created: fieldActionsValidateAndBuildResult.created,
+ deleted: fieldActionsValidateAndBuildResult.deleted,
+ updated: fieldActionsValidateAndBuildResult.updated,
+ },
+ objectActions: {
+ created: objectActionsValidateAndBuildResult.created,
+ deleted: objectActionsValidateAndBuildResult.deleted,
+ updated: objectActionsValidateAndBuildResult.updated,
},
optimisticFlatObjectMetadataMaps:
fieldActionsValidateAndBuildResult.optimisticFlatObjectMetadataMaps,