Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Aug 28, 2024
1 parent 4bdc286 commit fb3e3fb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
7 changes: 0 additions & 7 deletions prisma/example.mongodb.schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ model Guild {
stay Stay?
dj Dj?
roles Role[]
botchannel Botchannel?
setup Setup?
}

Expand Down Expand Up @@ -64,12 +63,6 @@ model Song {
@@unique([track, playlistId])
}

model Botchannel {
guildId String @id @map("_id")
textId String
Guild Guild @relation(fields: [guildId], references: [guildId])
}

model Setup {
guildId String @id @map("_id")
textId String
Expand Down
7 changes: 0 additions & 7 deletions prisma/example.postgresql.schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ model Guild {
stay Stay?
dj Dj?
roles Role[]
botchannel Botchannel?
setup Setup?
}

Expand Down Expand Up @@ -64,12 +63,6 @@ model Song {
@@unique([track, playlistId])
}

model Botchannel {
guildId String @id
textId String
Guild Guild @relation(fields: [guildId], references: [guildId])
}

model Setup {
guildId String @id
textId String
Expand Down
24 changes: 1 addition & 23 deletions src/database/server.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
type Botchannel,
type Dj,
type Guild,
type Playlist,
PrismaClient,
type Role,
type Setup,
type Song,
type Stay,
} from "@prisma/client";
import { type Dj, type Guild, type Playlist, PrismaClient, type Role, type Setup, type Song, type Stay } from "@prisma/client";
import config from "../config.js";

export default class ServerData {
Expand Down Expand Up @@ -87,18 +77,6 @@ export default class ServerData {
await this.prisma.role.deleteMany({ where: { guildId } });
}

public async getBotChannel(guildId: string): Promise<Botchannel | null> {
return await this.prisma.botchannel.findUnique({ where: { guildId } });
}

public async setBotChannel(guildId: string, textId: string): Promise<void> {
await this.prisma.botchannel.upsert({
where: { guildId },
update: { textId },
create: { guildId, textId },
});
}

public async getSetup(guildId: string): Promise<Setup | null> {
return await this.prisma.setup.findUnique({ where: { guildId } });
}
Expand Down

0 comments on commit fb3e3fb

Please sign in to comment.