generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model GuildConfig {
  id          String   @id @default(cuid())
  guildId     String   @unique
  logChannelId String?
  createdAt   DateTime @default(now())
  updatedAt   DateTime @updatedAt
}

model Warning {
  id          String   @id @default(cuid())
  guildId     String
  userId      String
  moderatorId String
  reason      String
  createdAt   DateTime @default(now())

  @@index([guildId, userId])
}

model NotificationRule {
  id          String   @id @default(cuid())
  guildId     String
  channelId   String
  cronExpr    String
  message     String
  enabled     Boolean  @default(true)
  createdAt   DateTime @default(now())
  updatedAt   DateTime @updatedAt

  @@index([guildId, enabled])
}
