diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-09-02 02:21:42 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-09-02 02:21:42 +1000 |
commit | 2f48212e6e6813f90eb13cf8ed79e0ebb3440b31 (patch) | |
tree | 792587a7f3dee4ef09973b21460e12d238d9b792 /src/util/entities/Role.ts | |
parent | Merge branch 'master' of github.com:spacebarchat/server (diff) | |
download | server-2f48212e6e6813f90eb13cf8ed79e0ebb3440b31.tar.xz |
typeorm inverse relations of guild relations
Diffstat (limited to 'src/util/entities/Role.ts')
-rw-r--r-- | src/util/entities/Role.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/entities/Role.ts b/src/util/entities/Role.ts index 9a601f31..e8e5feda 100644 --- a/src/util/entities/Role.ts +++ b/src/util/entities/Role.ts @@ -23,12 +23,12 @@ import { Guild } from "./Guild"; @Entity("roles") export class Role extends BaseClass { - @Column({ nullable: true }) + @Column() @RelationId((role: Role) => role.guild) guild_id: string; @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild, { + @ManyToOne(() => Guild, (guild) => guild.roles, { onDelete: "CASCADE", }) guild: Guild; |