-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from chingu-x/chore/me-endpoint
Add status to Voyage table and return in the /me endpoint
- Loading branch information
Showing
11 changed files
with
102 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
prisma/migrations/20240121062627_add_status_to_voyage/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- AlterTable | ||
ALTER TABLE "Voyage" ADD COLUMN "statusId" INTEGER; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Voyage" ADD CONSTRAINT "Voyage_statusId_fkey" FOREIGN KEY ("statusId") REFERENCES "VoyageStatus"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
const prisma = new PrismaClient(); | ||
|
||
export const populateVoyages = async () => { | ||
await prisma.voyage.create({ | ||
data: { | ||
number: "47", | ||
status: { | ||
connect: { | ||
name: "Active", | ||
}, | ||
}, | ||
startDate: new Date("2024-01-08"), | ||
endDate: new Date("2024-02-18"), | ||
soloProjectDeadline: new Date("2023-12-31"), | ||
certificateIssueDate: new Date("2024-02-25"), | ||
}, | ||
}); | ||
await prisma.voyage.create({ | ||
data: { | ||
number: "48", | ||
status: { | ||
connect: { | ||
name: "Upcoming", | ||
}, | ||
}, | ||
startDate: new Date("2024-03-05"), | ||
endDate: new Date("2024-04-14"), | ||
soloProjectDeadline: new Date("2024-02-25"), | ||
certificateIssueDate: new Date("2024-04-21"), | ||
}, | ||
}); | ||
await prisma.voyage.create({ | ||
data: { | ||
number: "49", | ||
status: { | ||
connect: { | ||
name: "Upcoming", | ||
}, | ||
}, | ||
startDate: new Date("2024-05-06"), | ||
endDate: new Date("2024-06-16"), | ||
soloProjectDeadline: new Date("2024-04-28"), | ||
certificateIssueDate: new Date("2024-06-23"), | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters