Files
twenty/packages/twenty-server/src/engine/metadata-modules/logic-function-layer/logic-function-layer.entity.ts
T
Charles Bochet 402d149ee1 Remove logic function layer (#17697)
## Remove logic function layer

Package.json and yarn.lock are now on the application entity, so the
logic function layer is no longer used except as a legacy source for the
1.17 backfill. This PR removes all layer usage outside of that migration
and keeps only the entity for backfill.

### Summary

- **Kept:** `LogicFunctionLayerEntity` and its table, only used by the
1.17 backfill command to read legacy layer data and backfill application
package files.
- **Removed:** All other layer logic: CRUD, cache, resolvers, services,
DTOs, and frontend types. Logic functions now depend only on the
application for package/dependency context.


### Why Dependencies instead of Source for package files

Package.json and yarn.lock are the application’s dependency set and are
stored under the application in **FileFolder.Dependencies**. The build
service and drivers now read them only from Dependencies; nothing is
written to Source for these files.
2026-02-04 10:17:27 +01:00

38 lines
941 B
TypeScript

import { type PackageJson } from 'type-fest';
import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { WorkspaceRelatedEntity } from 'src/engine/workspace-manager/types/workspace-related-entity';
@Entity('logicFunctionLayer')
export class LogicFunctionLayerEntity extends WorkspaceRelatedEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: 'jsonb', nullable: false })
packageJson: PackageJson;
@Column({ type: 'text', nullable: false })
yarnLock: string;
@Column({ type: 'text', nullable: true })
packageJsonChecksum?: string;
@Column({ type: 'text', nullable: false })
yarnLockChecksum: string;
@Column({ type: 'jsonb', nullable: false, default: {} })
availablePackages: Record<string, string>;
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
@UpdateDateColumn({ type: 'timestamptz' })
updatedAt: Date;
}