eletrotupi / tcc/ commit / b4d55cb

api: create reminders

Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago b4d55cb6c0798e104724a081ee5745a111ff3b6e Browse files
Parents ad630cb
Changed files
2
Additions
+20
Deletions
0
/dev/null → api/prisma/migrations/20260504224941_create_reminders/migration.sql
1 +
-- CreateTable
2 +
CREATE TABLE "reminders" (
3 +
    "id" SERIAL NOT NULL,
4 +
    "hour" INTEGER NOT NULL,
5 +
    "minute" INTEGER NOT NULL,
6 +
    "description" TEXT,
7 +
    "active" BOOLEAN NOT NULL DEFAULT false,
8 +

9 +
    CONSTRAINT "reminders_pkey" PRIMARY KEY ("id")
10 +
);
api/prisma/schema.prisma
1 1
generator client {
2 2
  provider = "prisma-client-js"
3 3
  //output   = "../src/generated/prisma"
4 4
}
5 5

74 74
  user User @relation(fields: [userId], references: [id])
75 75

76 76
  @@map("triggers")
77 77
}
78 78

79 +
model Reminder {
80 +
  id Int @id @default(autoincrement())
81 +
  hour Int
82 +
  minute Int
83 +
  description String?
84 +
  active Boolean @default(false)
85 +

86 +
  @@map("reminders")
87 +
}
88 +

79 89
enum IntensityLevel {
80 90
  LIGHT
81 91
  MODERATE
82 92
  HIGH
83 93
}
95 105
  ENVIRONMENTAL
96 106
  EMOTIONAL
97 107
  PHYSICAL
98 108
  OTHER
99 109
}