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

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

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

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