From fa354b4c1c6ff6627cdd403ae172f6d6362fe253 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Mon, 13 Apr 2026 19:53:33 +0200 Subject: [PATCH] Remove orphaned workspaceId column from BillingSubscriptionItemEntity (#19660) ## Summary - Removes the `workspaceId` column, `@Index()`, and `@ManyToOne` workspace relation from `BillingSubscriptionItemEntity` - The entity defined these fields but they don't exist in the actual database table, causing `column X.workspaceId does not exist` errors at runtime - The workspace relationship is already accessible through the parent `BillingSubscriptionEntity` --- .../entities/billing-subscription-item.entity.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription-item.entity.ts b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription-item.entity.ts index edf415ec3b..663ad541e2 100644 --- a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription-item.entity.ts +++ b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription-item.entity.ts @@ -5,7 +5,6 @@ import { Column, CreateDateColumn, Entity, - Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn, @@ -17,7 +16,6 @@ import { import { BillingProductEntity } from 'src/engine/core-modules/billing/entities/billing-product.entity'; import { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entities/billing-subscription.entity'; import { BillingSubscriptionItemMetadata } from 'src/engine/core-modules/billing/types/billing-subscription-item-metadata.type'; -import type { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity'; @Entity({ name: 'billingSubscriptionItem', schema: 'core' }) @Unique( 'IDX_BILLING_SUBSCRIPTION_ITEM_BILLING_SUBSCRIPTION_ID_STRIPE_PRODUCT_ID_UNIQUE', @@ -27,14 +25,6 @@ export class BillingSubscriptionItemEntity { @PrimaryGeneratedColumn('uuid') id: string; - @Column({ nullable: false, type: 'uuid' }) - @Index() - workspaceId: string; - - @ManyToOne('WorkspaceEntity', { onDelete: 'CASCADE' }) - @JoinColumn({ name: 'workspaceId' }) - workspace: Relation; - @Column({ nullable: true, type: 'timestamptz' }) deletedAt?: Date;