import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
import { TranslationEntity } from 'typeorm-translatable';
import { Category } from './category.entity';

@Entity()
export class CategoryTranslation extends TranslationEntity<Category> {
  @Column({ unique: false, default: '', length: 200 })
  title?: string;

  @Column({ type: 'longtext', nullable: true })
  remark?: string;

  @ManyToOne(() => Category, (category) => category.translations, {
    // onDelete: 'CASCADE',
    createForeignKeyConstraints: false,
  })
  source?: Category | undefined;
}
