relay/prisma/schema.prisma
2025-05-05 17:05:59 +01:00

106 lines
2.1 KiB
Plaintext

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
}
model Feed {
id Int @id @default(autoincrement())
name String
url String
guild_id String
active Boolean
created_at DateTime @default(now())
updated_at DateTime @updatedAt
channels Channel[]
filters Filter[]
@@unique([guild_id, name])
@@index([guild_id, created_at(sort: Desc)])
}
model Channel {
id Int @id @default(autoincrement())
channel_id String
Feed Feed @relation(fields: [feedId], references: [id], onDelete: Cascade)
feedId Int
}
model Filter {
id Int @id @default(autoincrement())
guild_id String
name String
value String
matching_algorithm MatchingAlgorithms
is_insensitive Boolean
is_whitelist Boolean
created_at DateTime @default(now())
updated_at DateTime @updatedAt
feeds Feed[]
@@unique([guild_id, name])
@@index([guild_id, created_at(sort: Desc)])
}
enum MatchingAlgorithms {
ANY
ALL
EXACT
REGEX
FUZZY
}
model MessageStyle {
id Int @id @default(autoincrement())
guild_id String
name String
show_author Boolean
show_image Boolean
show_thumbnail Boolean
show_footer Boolean
show_timestamp Boolean
colour String @db.VarChar(6)
title_mutator TextMutator?
description_mutator TextMutator?
created_at DateTime @default(now())
updated_at DateTime @updatedAt
@@unique([guild_id, name])
@@index([guild_id, created_at(sort: Desc)])
}
// Entertainment mutators for message styles
enum TextMutator {
UWUIFY
UWUIFY_SFW
GOTHIC_SCRIPT
EMOJI_SUBSTITUTE
ZALGO
MORSE_CODE
BINARY
HEXADECIMAL
REMOVE_VOWELS
DOUBLE_CHARACTERS
SMALL_CASE
LEET_SPEAK
PIG_LATIN
UPSIDE_DOWN
ALL_REVERSED
REVERSED_WORDS
SHUFFLE_WORDS
RANDOM_CASE
GIBBERISH
SHAKESPEAREAN
}