Skip to content

Commit

Permalink
new schema new you
Browse files Browse the repository at this point in the history
  • Loading branch information
DCRepublic committed Nov 27, 2024
1 parent 17e88cf commit 09f3772
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
3 changes: 0 additions & 3 deletions app/actions/getCourses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export async function getPlanCourses(planID: any) {
//let DOTW: Array<String> = dotw.split(",");

return await prisma.course.findMany({
relationLoadStrategy: "join", // or 'query'
where: {
CoursePlan: {
some: {
Expand Down Expand Up @@ -118,7 +117,6 @@ export async function getInitialCourses(
) {
const startTime = stime.toString().split(",").filter(Number);
return await prisma.course.findMany({
relationLoadStrategy: "join", // or 'query'
take: 20,
where: {
...(term
Expand Down Expand Up @@ -150,7 +148,6 @@ export async function getCourses(
const startTime = stime.toString().split(",").filter(Number);

return await prisma.course.findMany({
relationLoadStrategy: "join", // or 'query'
take: take,

include: {
Expand Down
1 change: 0 additions & 1 deletion components/PlanCardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ async function getPlanCourses(planID: any) {
//let DOTW: Array<String> = dotw.split(",");

return await prisma.course.findMany({
relationLoadStrategy: "join", // or 'query'
where: {
CoursePlan: {
some: {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- "traefik.http.routers.planner.tls=true"
- "traefik.http.routers.planner.tls.certresolver=letsEncrypt"
- "traefik.http.services.planner.loadbalancer.server.port=3000"
command: sh -c "sleep 5 && npm start "
command: sh -c "sleep 5 && npx prisma migrate deploy && npm start "
networks:
- traefik
- internal
Expand Down
12 changes: 12 additions & 0 deletions prisma/migrations/20241127184134_new_schema_new_you/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:
- A unique constraint covering the columns `[uid]` on the table `Faculty` will be added. If there are existing duplicate values, this will fail.
- Made the column `uid` on table `Faculty` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "Faculty" ALTER COLUMN "uid" SET NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "Faculty_uid_key" ON "Faculty"("uid");
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ model Course {

model Faculty {
id Int @id @default(autoincrement())
uid String?
uid String @unique
bannerId String
displayName String
emailAddress String
Expand Down
2 changes: 1 addition & 1 deletion swatscraper
Submodule swatscraper updated 1 files
+1 −1 main.go

0 comments on commit 09f3772

Please sign in to comment.