import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm';
import { Workspace } from '../workspace/workspace.entity';

@Entity()
export class PluginConfig {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column()
  pluginId!: string;

  @Column({ type: 'json', nullable: true })
  settings!: Record<string, any>;

  @OneToOne(() => Workspace)
  @JoinColumn()
  workspace!: Workspace;
}