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' },
|
||||
icon: { type: 'string' },
|
||||
isCustom: { type: 'boolean' },
|
||||
isRemote: { type: 'boolean' },
|
||||
isActive: { type: 'boolean' },
|
||||
isSystem: { type: 'boolean' },
|
||||
createdAt: { type: 'string' },
|
||||
|
||||
@ -74,6 +74,7 @@ export const currencyObjectDefinition = {
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
} satisfies ObjectMetadataInterface;
|
||||
|
||||
export type CurrencyMetadata = {
|
||||
|
||||
@ -74,6 +74,7 @@ export const fullNameObjectDefinition = {
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
} satisfies ObjectMetadataInterface;
|
||||
|
||||
export type FullNameMetadata = {
|
||||
|
||||
@ -74,6 +74,7 @@ export const linkObjectDefinition = {
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
} satisfies ObjectMetadataInterface;
|
||||
|
||||
export type LinkMetadata = {
|
||||
|
||||
@ -15,4 +15,5 @@ export interface ObjectMetadataInterface {
|
||||
isSystem: boolean;
|
||||
isCustom: boolean;
|
||||
isActive: boolean;
|
||||
isRemote: boolean;
|
||||
}
|
||||
|
||||
@ -53,6 +53,9 @@ export class ObjectMetadataDTO {
|
||||
@FilterableField()
|
||||
isCustom: boolean;
|
||||
|
||||
@FilterableField()
|
||||
isRemote: boolean;
|
||||
|
||||
@FilterableField()
|
||||
isActive: boolean;
|
||||
|
||||
|
||||
@ -55,6 +55,9 @@ export class ObjectMetadataEntity implements ObjectMetadataInterface {
|
||||
@Column({ default: false })
|
||||
isCustom: boolean;
|
||||
|
||||
@Column({ default: false })
|
||||
isRemote: boolean;
|
||||
|
||||
@Column({ default: false })
|
||||
isActive: boolean;
|
||||
|
||||
|
||||
@ -235,6 +235,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
isActive: true,
|
||||
isCustom: true,
|
||||
isSystem: false,
|
||||
isRemote: false,
|
||||
fields:
|
||||
// Creating default fields.
|
||||
// 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',
|
||||
isSystem,
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
description: params.description,
|
||||
icon: params.icon,
|
||||
gate,
|
||||
|
||||
@ -14,5 +14,6 @@ export interface ReflectObjectMetadata extends ObjectMetadataDecoratorParams {
|
||||
targetTableName: string;
|
||||
isSystem: boolean;
|
||||
isCustom: boolean;
|
||||
isRemote: boolean;
|
||||
gate?: GateDecoratorParams;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user