106 lines
2.5 KiB
Plaintext
106 lines
2.5 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[]
|
|
message_style MessageStyle? @relation(fields: [message_style_id], references: [id], onDelete: SetNull)
|
|
message_style_id Int?
|
|
published_threshold DateTime
|
|
|
|
@@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
|
|
colour String @db.VarChar(7) // hex colour: #5865F2
|
|
show_author Boolean
|
|
show_image Boolean
|
|
show_thumbnail Boolean
|
|
show_footer Boolean
|
|
show_timestamp Boolean
|
|
title_mutator TextMutator?
|
|
description_mutator TextMutator?
|
|
created_at DateTime @default(now())
|
|
updated_at DateTime @updatedAt
|
|
Feed Feed[]
|
|
|
|
@@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
|
|
}
|