Files
twenty/server/src/core/feature-flag/feature-flag.entity.ts
bosiraphael 18d30c45c4 Create feature flag table (#2752)
* feature flag working

* wip

* wip

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-11-28 20:19:39 +01:00

39 lines
791 B
TypeScript

import {
Entity,
Unique,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
} from 'typeorm';
import { Workspace } from 'src/core/workspace/workspace.entity';
@Entity({ name: 'featureFlag', schema: 'core' })
@Unique('IndexOnKeyAndWorkspaceIdUnique', ['key', 'workspaceId'])
export class FeatureFlagEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ nullable: false, type: 'text' })
key: string;
@Column({ nullable: false, type: 'uuid' })
workspaceId: string;
@ManyToOne(() => Workspace, (workspace) => workspace.featureFlags, {
onDelete: 'CASCADE',
})
workspace: Workspace;
@Column({ nullable: false })
value: boolean;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}