Initial rough working draft of v3

This commit is contained in:
Charlie Laabs
2021-12-19 16:59:13 -06:00
parent b777604bb3
commit 466c122dd2
27 changed files with 7581 additions and 1663 deletions

17
src/entity/Channel.ts Normal file
View File

@@ -0,0 +1,17 @@
/* eslint-disable import/no-cycle */
import { PrimaryColumn, Entity, ManyToOne, BaseEntity, Column } from 'typeorm';
import { Guild } from './Guild';
@Entity()
export class Channel extends BaseEntity {
@PrimaryColumn()
id: string;
@Column({
default: true,
})
listen: boolean;
@ManyToOne(() => Guild, (guild) => guild.channels)
guild: Guild;
}

12
src/entity/Guild.ts Normal file
View File

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