Files
markov-discord/src/entity/Guild.ts
2021-12-23 21:54:42 -06:00

13 lines
368 B
TypeScript

/* eslint-disable import/no-cycle */
import { BaseEntity, Entity, OneToMany, PrimaryColumn } from 'typeorm';
import { Channel } from './Channel';
@Entity()
export class Guild extends BaseEntity {
@PrimaryColumn({ type: 'text' })
id: string;
@OneToMany(() => Channel, (channel) => channel.guild, { onDelete: 'CASCADE', cascade: true })
channels: Channel[];
}