Skip to content

Commit

Permalink
feat(prisma): add review "written at" date field
Browse files Browse the repository at this point in the history
This patch adds a new `date` field to the `Review` object. This date
field will be `NULL` for consumer reviews (as the written at date for
consumer reviews will simply be createdAt/updatedAt). For critic
reviews, this is a separate field as most of the time, the date when the
critic review was originally written will be different from the date I
imported it.
  • Loading branch information
nicholaschiang committed Jul 25, 2023
1 parent e12c12d commit 0f4c5e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Review" ADD COLUMN "date" TIMESTAMP(3);
8 changes: 8 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,14 @@ model Review {
// The review article URL (if it was posted online e.g. on Vogue).
url String? @unique
// The date when the review article was originally written (if known).
//
// This will be NULL for consumer reviews (as this would be redundant with the
// database createdAt field for consumer reviews). For critic reviews, the
// date when the review was originally written and the time when I imported it
// will often be different (which is why this field exists separately).
date DateTime?
// Each user can only submit one review per show. This may be different for
// critic reviews, but, for now, I've yet to encounter the same journalist
// publishing two different reviews for the same show. If that does happen, I
Expand Down

0 comments on commit 0f4c5e9

Please sign in to comment.