Within my PostgreSQL database, I have a table that includes a column for the server's ID and a column for the user's ID, along with additional columns detailing punishments assigned to the user.
In the 'schema.prisma' file:
model users {
user_id BigInt
guild_id BigInt
bans Int
kicks Int
warns Int
}
I am looking to establish a unique link between the user_id and guild_id using @unique, then retrieve the user based on both the guild_id and user_id in typescript.
const query: any = await prisma.users.findMany({
where: {
user_id: BigInt("user_id"),
guild_id: BigInt("guild_id")
}
});