Add isRemote field on object metadata (#4668)
Add isRemote field Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -0,0 +1,17 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class AddIsRemoteField1711466822763 implements MigrationInterface {
|
||||||
|
name = 'AddIsRemoteField1711466822763';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "metadata"."objectMetadata" ADD "isRemote" boolean NOT NULL DEFAULT false`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "metadata"."objectMetadata" DROP COLUMN "isRemote"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -173,6 +173,7 @@ export const computeMetadataSchemaComponents = (
|
|||||||
description: { type: 'string' },
|
description: { type: 'string' },
|
||||||
icon: { type: 'string' },
|
icon: { type: 'string' },
|
||||||
isCustom: { type: 'boolean' },
|
isCustom: { type: 'boolean' },
|
||||||
|
isRemote: { type: 'boolean' },
|
||||||
isActive: { type: 'boolean' },
|
isActive: { type: 'boolean' },
|
||||||
isSystem: { type: 'boolean' },
|
isSystem: { type: 'boolean' },
|
||||||
createdAt: { type: 'string' },
|
createdAt: { type: 'string' },
|
||||||
|
|||||||
@ -74,6 +74,7 @@ export const currencyObjectDefinition = {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
|
isRemote: false,
|
||||||
} satisfies ObjectMetadataInterface;
|
} satisfies ObjectMetadataInterface;
|
||||||
|
|
||||||
export type CurrencyMetadata = {
|
export type CurrencyMetadata = {
|
||||||
|
|||||||
@ -74,6 +74,7 @@ export const fullNameObjectDefinition = {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
|
isRemote: false,
|
||||||
} satisfies ObjectMetadataInterface;
|
} satisfies ObjectMetadataInterface;
|
||||||
|
|
||||||
export type FullNameMetadata = {
|
export type FullNameMetadata = {
|
||||||
|
|||||||
@ -74,6 +74,7 @@ export const linkObjectDefinition = {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
|
isRemote: false,
|
||||||
} satisfies ObjectMetadataInterface;
|
} satisfies ObjectMetadataInterface;
|
||||||
|
|
||||||
export type LinkMetadata = {
|
export type LinkMetadata = {
|
||||||
|
|||||||
@ -15,4 +15,5 @@ export interface ObjectMetadataInterface {
|
|||||||
isSystem: boolean;
|
isSystem: boolean;
|
||||||
isCustom: boolean;
|
isCustom: boolean;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
isRemote: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,9 @@ export class ObjectMetadataDTO {
|
|||||||
@FilterableField()
|
@FilterableField()
|
||||||
isCustom: boolean;
|
isCustom: boolean;
|
||||||
|
|
||||||
|
@FilterableField()
|
||||||
|
isRemote: boolean;
|
||||||
|
|
||||||
@FilterableField()
|
@FilterableField()
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,9 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
|
|||||||
@Column({ default: false })
|
@Column({ default: false })
|
||||||
isCustom: boolean;
|
isCustom: boolean;
|
||||||
|
|
||||||
|
@Column({ default: false })
|
||||||
|
isRemote: boolean;
|
||||||
|
|
||||||
@Column({ default: false })
|
@Column({ default: false })
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
|
||||||
|
|||||||
@ -235,6 +235,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
isCustom: true,
|
isCustom: true,
|
||||||
isSystem: false,
|
isSystem: false,
|
||||||
|
isRemote: false,
|
||||||
fields:
|
fields:
|
||||||
// Creating default fields.
|
// Creating default fields.
|
||||||
// No need to create a custom migration for this though as the default columns are already
|
// No need to create a custom migration for this though as the default columns are already
|
||||||
|
|||||||
@ -19,6 +19,7 @@ export function ObjectMetadata(
|
|||||||
targetTableName: 'DEPRECATED',
|
targetTableName: 'DEPRECATED',
|
||||||
isSystem,
|
isSystem,
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
|
isRemote: false,
|
||||||
description: params.description,
|
description: params.description,
|
||||||
icon: params.icon,
|
icon: params.icon,
|
||||||
gate,
|
gate,
|
||||||
|
|||||||
@ -14,5 +14,6 @@ export interface ReflectObjectMetadata extends ObjectMetadataDecoratorParams {
|
|||||||
targetTableName: string;
|
targetTableName: string;
|
||||||
isSystem: boolean;
|
isSystem: boolean;
|
||||||
isCustom: boolean;
|
isCustom: boolean;
|
||||||
|
isRemote: boolean;
|
||||||
gate?: GateDecoratorParams;
|
gate?: GateDecoratorParams;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user