Add applicationId to syncableEntity and fix syncApp deletion (#15170)

## Context
- All flatEntity should extend SyncableEntity
- SyncableEntity should now have applicationId and application relation
- Fix syncApp deletion, should now properly use migration v2 to delete
syncable entities
This commit is contained in:
Weiko
2025-10-17 19:23:00 +02:00
committed by GitHub
parent 84e7fabaab
commit cceeb6ed4d
79 changed files with 734 additions and 271 deletions
@@ -1,4 +1,6 @@
import { Column, Index } from 'typeorm';
import { Column, Index, JoinColumn, ManyToOne, Relation } from 'typeorm';
import type { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
@Index(['workspaceId', 'universalIdentifier'], {
unique: true,
@@ -6,4 +8,14 @@ import { Column, Index } from 'typeorm';
export abstract class SyncableEntity {
@Column({ nullable: true, type: 'uuid' })
universalIdentifier: string | null;
@Column({ nullable: true, type: 'uuid' })
applicationId: string | null;
@ManyToOne('ApplicationEntity', {
onDelete: 'CASCADE',
nullable: true,
})
@JoinColumn({ name: 'applicationId' })
application: Relation<ApplicationEntity>;
}