api: add date column for triggers

Pedro Lucas Porcellis porcellis@eletrotupi.com 21 days ago 031a372a6e1f95cfbac1b82e2078da48a3674fb3
Parents: 39476e3
2 file(s) changed
  • api/prisma/migrations/20260529013012_add_moment_to_trigger/migration.sql +2 -0
  • api/prisma/schema.prisma +1 -0
api/prisma/migrations/20260529013012_add_moment_to_trigger/migration.sql
@@ -0,0 +1,2 @@
1 + -- AlterTable
2 + ALTER TABLE "triggers" ADD COLUMN "moment" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
api/prisma/schema.prisma
@@ -74,6 +74,7 @@ model Trigger {
74 74 id Int @id @default(autoincrement())
75 75 comment String? @db.Text
76 76 category TriggerType
77 + moment DateTime @default(now())
77 78
78 79 userId Int @map("user_id")
79 80 user User @relation(fields: [userId], references: [id])