feat: publish threshold field on Feed model

This commit is contained in:
Corban-Lee Jones 2025-05-08 01:14:35 +01:00
parent bab3759423
commit 6761a9163b
2 changed files with 24 additions and 11 deletions

View File

@ -0,0 +1,12 @@
/*
Warnings:
- Added the required column `published_threshold` to the `Feed` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Feed" ADD COLUMN "message_style_id" INTEGER,
ADD COLUMN "published_threshold" TIMESTAMP(3) NOT NULL;
-- AddForeignKey
ALTER TABLE "Feed" ADD CONSTRAINT "Feed_message_style_id_fkey" FOREIGN KEY ("message_style_id") REFERENCES "MessageStyle"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -12,17 +12,18 @@ datasource db {
}
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?
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)])