57 lines
1.3 KiB
Plaintext
57 lines
1.3 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 = "sqlite"
|
|
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[]
|
|
|
|
@@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[]
|
|
|
|
@@index([guild_id, created_at(sort: Desc)])
|
|
}
|
|
|
|
enum MatchingAlgorithms {
|
|
ANY
|
|
ALL
|
|
EXACT
|
|
REGEX
|
|
FUZZY
|
|
}
|